HapplyUI

Components

Key Icon

An icon container with configurable styles, sizes, and semantic colors.


Installation

bunx @happlyui/cli@latest add key-icon

Dependencies

Registry dependencies

These are automatically installed when you add this component.

  • tv
  • happly-ui-utils

Usage

import * as KeyIcon from "@/components/ui/key-icon"

<KeyIcon.Root icon={<RiHomeLine />} />

Examples

Stroke Style

Default stroke style with neutral border and shadow.

<KeyIcon.Root icon={<RiHomeLine />} />

Lighter Style

Lighter style with semantic background and border colors.

<KeyIcon.Root style="lighter" color="blue" icon={<RiSearchLine />} />

Filled Style

Solid background with white icon for high emphasis.

<KeyIcon.Root style="filled" color="blue" icon={<RiSearchLine />} />

Sizes

Available sizes from sm (32px) to 2xl (64px).

sm
md
lg
xl
2xl
<KeyIcon.Root size="lg" icon={<RiHomeLine />} />

Colors

All available semantic colors in both styles.

gray
blue
orange
red
green
yellow
purple
pink
teal
primary
<KeyIcon.Root style="lighter" color="green" icon={<RiCheckLine />} />

API Reference

KeyIcon.Root

The icon container element.

PropTypeDefaultDescription
iconReact.ReactNode-The icon to display. Alternatively, pass as children.
size'sm' | 'md' | 'lg' | 'xl' | '2xl''md'Container size.
style'stroke' | 'lighter' | 'filled''stroke'Visual style variant.
color'gray' | 'blue' | 'orange' | 'red' | 'green' | 'yellow' | 'purple' | 'pink' | 'teal' | 'primary''gray'Semantic color. Affects the lighter and filled styles.

Previous
Kbd