Buckets:
| import { Button as Kobalte } from "@kobalte/core/button" | |
| import { type ComponentProps, Show, splitProps } from "solid-js" | |
| import { Icon, IconProps } from "./icon" | |
| export interface ButtonProps | |
| extends ComponentProps<typeof Kobalte>, | |
| Pick<ComponentProps<"button">, "class" | "classList" | "children"> { | |
| size?: "small" | "normal" | "large" | |
| variant?: "primary" | "secondary" | "ghost" | |
| icon?: IconProps["name"] | |
| } | |
| export function Button(props: ButtonProps) { | |
| const [split, rest] = splitProps(props, ["variant", "size", "icon", "class", "classList"]) | |
| return ( | |
| <Kobalte | |
| {...rest} | |
| data-component="button" | |
| data-size={split.size || "normal"} | |
| data-variant={split.variant || "secondary"} | |
| data-icon={split.icon} | |
| classList={{ | |
| ...split.classList, | |
| [split.class ?? ""]: !!split.class, | |
| }} | |
| > | |
| <Show when={split.icon}> | |
| <Icon name={split.icon!} size="small" /> | |
| </Show> | |
| {props.children} | |
| </Kobalte> | |
| ) | |
| } | |
Xet Storage Details
- Size:
- 994 Bytes
- Xet hash:
- a2f00eef7fc102a2bcb707784cb72e0bddb06ddcf8d00f1aee662f141e58b72d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.