GHHG10's picture
download
raw
979 Bytes
import { Button as Kobalte } from "@kobalte/core/button"
import { type ComponentProps, splitProps } from "solid-js"
import { Icon, IconProps } from "./icon"
export interface IconButtonProps extends ComponentProps<typeof Kobalte> {
icon: IconProps["name"]
size?: "small" | "normal" | "large"
iconSize?: IconProps["size"]
variant?: "primary" | "secondary" | "ghost"
}
export function IconButton(props: ComponentProps<"button"> & IconButtonProps) {
const [split, rest] = splitProps(props, ["variant", "size", "iconSize", "class", "classList"])
return (
<Kobalte
{...rest}
data-component="icon-button"
data-icon={props.icon}
data-size={split.size || "normal"}
data-variant={split.variant || "secondary"}
classList={{
...split.classList,
[split.class ?? ""]: !!split.class,
}}
>
<Icon name={props.icon} size={split.iconSize ?? (split.size === "large" ? "normal" : "small")} />
</Kobalte>
)
}

Xet Storage Details

Size:
979 Bytes
·
Xet hash:
039b99c6f9092cc230d42510e7cca0c9afaf5a524506fe1c6741b975cb07ca0e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.