🔥 看看我們的新專案 t0ggles - 你終極的專案管理工具! 🔥

列表按鈕 React 組件

列表按鈕旨在於 列表 React 組件 內使用。

列表按鈕組件

包含以下組件

  • ListButton

ListButton 屬性

名稱類型預設值描述
colors物件

具有 Tailwind CSS 顏色類別的物件

colors.activeBgIos字串'active:bg-primary active:bg-opacity-15'
colors.activeBgMaterial字串''
colors.textIos字串'text-primary'
colors.textMaterial字串'text-md-light-primary dark:text-md-dark-primary'
colors.touchRipple字串'touch-ripple-primary'
component字串'li'

組件的 HTML 元素

href字串

按鈕的連結 href 屬性

linkComponent字串'a'

按鈕 HTML 元素

linkProps任意

具有要傳遞給連結/按鈕的其他屬性(特性)的物件

target字串

按鈕的連結 target 屬性

touchRipple布林值true

在 Material 主題中啟用觸碰漣漪效果

type字串未定義

按鈕的 type 屬性(如果以 <button> 搭配 linkComponent: 'button' 呈現)

value任意

按鈕的 type 屬性(如果以 <button> 搭配 linkComponent: 'button' 呈現)

範例

ListButton.jsx
import React from 'react';
import { Page, Navbar, NavbarBackLink, List, ListButton } from 'konsta/react';
export default function ListButtonPage() {
return (
<Page>
<Navbar
title="List Button"
/>
<List strong outlineIos>
<ListButton>Button 1</ListButton>
<ListButton>Button 2</ListButton>
<ListButton>Button 3</ListButton>
</List>
<List inset strong>
<ListButton>Button 1</ListButton>
<ListButton>Button 2</ListButton>
<ListButton>Button 3</ListButton>
</List>
<List inset strong>
<ListButton className="k-color-brand-red">Red Button</ListButton>
</List>
</Page>
);
}
程式碼授權於 MIT.
2022 © Konsta UI 作者 nolimits4web.