コンポーネント
Button
ボタン、またはボタンのような見た目のコンポーネントを表示します。
使い方
import { Button } from "@murasakijs/ui";<Button>Button</Button>バリアント
variant と size プロパティで、ボタンの見た目を変更できます。
API リファレンス
Props
| Prop | 型 | デフォルト |
|---|---|---|
variant | "default" | "secondary" | "outline" | "ghost" | "destructive" | "link" | "default" |
size | "default" | "sm" | "lg" | "icon" | "default" |
asChild | boolean | false |
Button の押下と focus-visible の挙動は React Aria が提供します。asChild を指定すると、<button> の代わりに子要素をレンダリングするため、ルーターの Link などにもボタンスタイルを適用できます。