Skip to content

Styled Components

These components are thin wrappers around standard HTML elements with consistent Tailwind CSS styling and variant support. They don't use Zag.js state machines — they're simple, predictable, and easy to compose.

All styled components accept a class prop for additional Tailwind classes.

Button

A button with variant and size props.

Variants

VariantDescription
defaultSolid primary background
destructiveRed/danger styling
outlineBordered with transparent background
secondaryMuted background
ghostNo background until hovered
linkStyled as an underlined link

Sizes

SizeDescription
defaultStandard height (36px)
smCompact (32px)
lgLarger (40px)
iconSquare (36×36px)

Usage

tsx
import { Button } from '@geajs/ui'

<Button>Default</Button>
<Button variant="destructive">Delete</Button>
<Button variant="outline">Outline</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="link">Link</Button>

<Button size="sm">Small</Button>
<Button size="lg">Large</Button>
<Button size="icon">🔍</Button>

<Button disabled>Disabled</Button>

Props

PropTypeDefaultDescription
variant'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link''default'Visual style
size'default' | 'sm' | 'lg' | 'icon''default'Button size
disabledbooleanfalseDisables the button
typestring'button'HTML button type
classstringAdditional CSS classes

Card

A content container with optional header, footer, title, and description slots.

Usage

tsx
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@geajs/ui'

<Card>
  <CardHeader>
    <CardTitle>Card Title</CardTitle>
    <CardDescription>Card description text.</CardDescription>
  </CardHeader>
  <CardContent>
    <p>Card content goes here.</p>
  </CardContent>
  <CardFooter>
    <Button>Action</Button>
  </CardFooter>
</Card>

Sub-components

ComponentPurpose
CardOuter container with border, shadow, and rounded corners
CardHeaderTop section with vertical spacing
CardTitleHeading inside the header
CardDescriptionMuted text below the title
CardContentMain body area
CardFooterBottom section, typically for actions

Input

A styled text input.

tsx
import { Input } from '@geajs/ui'

<Input type="email" placeholder="Email" />
<Input type="password" placeholder="Password" />
<Input disabled placeholder="Disabled" />

Props

PropTypeDefaultDescription
typestring'text'HTML input type
placeholderstringPlaceholder text
valuestringCurrent value
disabledbooleanfalseDisables the input
namestringForm field name
inputIdstringHTML id attribute (use with Label htmlFor)
onInput(e: Event) => voidInput event handler
classstringAdditional CSS classes

Textarea

A styled multi-line text input.

tsx
import { Textarea } from '@geajs/ui'

<Textarea placeholder="Type your message..." rows={4} />
<Textarea disabled placeholder="Disabled" />

Props

PropTypeDefaultDescription
placeholderstringPlaceholder text
valuestringCurrent value
rowsnumberVisible rows
disabledbooleanfalseDisables the textarea
namestringForm field name
onInput(e: Event) => voidInput event handler
classstringAdditional CSS classes

Label

A form label.

tsx
import { Label } from '@geajs/ui'

<Label htmlFor="email">Email</Label>

Props

PropTypeDefaultDescription
htmlForstringID of the associated form element
classstringAdditional CSS classes

Badge

A small status indicator.

Variants

VariantDescription
defaultSolid primary background
secondaryMuted background
destructiveRed/danger styling
outlineBordered with transparent background

Usage

tsx
import { Badge } from '@geajs/ui'

<Badge>Default</Badge>
<Badge variant="secondary">Secondary</Badge>
<Badge variant="destructive">Destructive</Badge>
<Badge variant="outline">Outline</Badge>

Props

PropTypeDefaultDescription
variant'default' | 'secondary' | 'destructive' | 'outline''default'Visual style
classstringAdditional CSS classes

Alert

An inline notification with a title and description.

Variants

VariantDescription
defaultNeutral styling
destructiveRed/danger styling

Usage

tsx
import { Alert, AlertTitle, AlertDescription } from '@geajs/ui'

<Alert>
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>This is an informational alert.</AlertDescription>
</Alert>

<Alert variant="destructive">
  <AlertTitle>Error</AlertTitle>
  <AlertDescription>Something went wrong.</AlertDescription>
</Alert>

Sub-components

ComponentPurpose
AlertOuter container, accepts variant
AlertTitleBold heading
AlertDescriptionBody text

Separator

A horizontal or vertical divider.

tsx
import { Separator } from '@geajs/ui'

<Separator />
<Separator orientation="vertical" />
<Separator class="my-6" />

Props

PropTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'Direction
classstringAdditional CSS classes

Skeleton

A loading placeholder that pulses to indicate content is being loaded.

tsx
import { Skeleton } from '@geajs/ui'

<Skeleton class="h-4 w-[250px]" />
<Skeleton class="h-12 w-12 rounded-full" />
<Skeleton class="h-[125px] w-full rounded-xl" />

Shape the skeleton by passing Tailwind utility classes through the class prop — width, height, and border-radius control the placeholder's dimensions and shape.

Released under the MIT License.