Skip to content

pika-ux Module Reference

The pika-ux package provides pre-built UI components and design system elements for building web components that integrate seamlessly with Pika chat applications.

Terminal window
npm install pika-ux

Pre-built, accessible UI components based on shadcn/ui:

  • Fully accessible (WCAG compliant)
  • Customizable with Tailwind CSS
  • Type-safe with TypeScript
  • Works with Svelte 5 (runes mode)

Additional components specific to Pika Platform functionality.

ComponentDescriptionImport
CardFlexible content containerpika-ux/shadcn/card
SeparatorVisual dividerpika-ux/shadcn/separator
SidebarCollapsible sidebar navigationpika-ux/shadcn/sidebar
ComponentDescriptionImport
InputText input fieldpika-ux/shadcn/input
LabelForm labelpika-ux/shadcn/label
CheckboxCheckbox inputpika-ux/shadcn/checkbox
RadioGroupRadio button grouppika-ux/shadcn/radio-group
SelectDropdown selectpika-ux/shadcn/select
SwitchToggle switchpika-ux/shadcn/switch
TextareaMulti-line text inputpika-ux/shadcn/textarea
ComponentDescriptionImport
DialogModal dialogpika-ux/shadcn/dialog
AlertDialogConfirmation dialogpika-ux/shadcn/alert-dialog
TooltipHover tooltippika-ux/shadcn/tooltip
PopoverFloating popoverpika-ux/shadcn/popover
ToastNotification messagepika-ux/shadcn/toast
ProgressProgress indicatorpika-ux/shadcn/progress
ComponentDescriptionImport
Dropdown MenuDropdown menupika-ux/shadcn/dropdown-menu
TabsTabbed interfacepika-ux/shadcn/tabs
BreadcrumbBreadcrumb navigationpika-ux/shadcn/breadcrumb
ComponentDescriptionImport
TableData tablepika-ux/shadcn/table
BadgeStatus badgepika-ux/shadcn/badge
AvatarUser avatarpika-ux/shadcn/avatar
ComponentDescriptionImport
TooltipPlusEnhanced tooltip with additional featurespika-ux/pika/tooltip-plus
ExpandableContainerCollapsible content containerpika-ux/pika/expandable-container
<script lang="ts">
import { Button } from 'pika-ux/shadcn/button';
function handleClick() {
console.log('Button clicked!');
}
</script>
<Button onclick={handleClick} variant="default" size="lg">
Click Me
</Button>
<Button variant="outline" size="sm">
Secondary Action
</Button>
<Button variant="ghost">
Ghost Button
</Button>

Button Variants:

  • default - Primary button style
  • destructive - For destructive actions
  • outline - Outlined button
  • secondary - Secondary style
  • ghost - Minimal style
  • link - Link-styled button

Button Sizes:

  • default - Standard size
  • sm - Small
  • lg - Large
  • icon - Square for icons
<script lang="ts">
import * as Dialog from 'pika-ux/shadcn/dialog';
import { Button } from 'pika-ux/shadcn/button';
let dialogOpen = $state(false);
</script>
<Button onclick={() => dialogOpen = true}>
Open Dialog
</Button>
<Dialog.Root bind:open={dialogOpen}>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Dialog Title</Dialog.Title>
<Dialog.Description>
This is a description of the dialog content.
</Dialog.Description>
</Dialog.Header>
<div class="py-4">
<!-- Dialog content -->
<p>Your dialog content goes here.</p>
</div>
<Dialog.Footer>
<Button variant="outline" onclick={() => dialogOpen = false}>
Cancel
</Button>
<Button onclick={() => dialogOpen = false}>
Confirm
</Button>
</Dialog.Footer>
</Dialog.Content>
</Dialog.Root>
<script lang="ts">
import * as Card from 'pika-ux/shadcn/card';
import { Button } from 'pika-ux/shadcn/button';
</script>
<Card.Root>
<Card.Header>
<Card.Title>Card Title</Card.Title>
<Card.Description>Card description goes here</Card.Description>
</Card.Header>
<Card.Content>
<p>Main content of the card</p>
</Card.Content>
<Card.Footer>
<Button>Action</Button>
</Card.Footer>
</Card.Root>
<script lang="ts">
import { Input } from 'pika-ux/shadcn/input';
import { Label } from 'pika-ux/shadcn/label';
let email = $state('');
</script>
<div class="space-y-2">
<Label for="email">Email</Label>
<Input
id="email"
type="email"
placeholder="you@example.com"
bind:value={email}
/>
</div>
<script lang="ts">
import * as Select from 'pika-ux/shadcn/select';
let selectedValue = $state('');
</script>
<Select.Root bind:value={selectedValue}>
<Select.Trigger>
<Select.Value placeholder="Select an option" />
</Select.Trigger>
<Select.Content>
<Select.Item value="option1">Option 1</Select.Item>
<Select.Item value="option2">Option 2</Select.Item>
<Select.Item value="option3">Option 3</Select.Item>
</Select.Content>
</Select.Root>
<script lang="ts">
import { Checkbox } from 'pika-ux/shadcn/checkbox';
import { Label } from 'pika-ux/shadcn/label';
let checked = $state(false);
</script>
<div class="flex items-center space-x-2">
<Checkbox id="terms" bind:checked />
<Label for="terms">Accept terms and conditions</Label>
</div>
<script lang="ts">
import * as Tabs from 'pika-ux/shadcn/tabs';
</script>
<Tabs.Root value="tab1" class="w-full">
<Tabs.List>
<Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
<Tabs.Trigger value="tab2">Tab 2</Tabs.Trigger>
<Tabs.Trigger value="tab3">Tab 3</Tabs.Trigger>
</Tabs.List>
<Tabs.Content value="tab1">
<p>Content for Tab 1</p>
</Tabs.Content>
<Tabs.Content value="tab2">
<p>Content for Tab 2</p>
</Tabs.Content>
<Tabs.Content value="tab3">
<p>Content for Tab 3</p>
</Tabs.Content>
</Tabs.Root>
<script lang="ts">
import * as Table from 'pika-ux/shadcn/table';
const data = [
{ id: 1, name: 'John Doe', email: 'john@example.com' },
{ id: 2, name: 'Jane Smith', email: 'jane@example.com' }
];
</script>
<Table.Root>
<Table.Header>
<Table.Row>
<Table.Head>ID</Table.Head>
<Table.Head>Name</Table.Head>
<Table.Head>Email</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{#each data as row}
<Table.Row>
<Table.Cell>{row.id}</Table.Cell>
<Table.Cell>{row.name}</Table.Cell>
<Table.Cell>{row.email}</Table.Cell>
</Table.Row>
{/each}
</Table.Body>
</Table.Root>

All pika-ux components are styled with Tailwind CSS and can be customized:

<Button class="mt-4 w-full bg-blue-600 hover:bg-blue-700">
Full Width Blue Button
</Button>
<Card.Root class="max-w-md shadow-lg">
<!-- Card content -->
</Card.Root>

Components automatically use the theme configured in your Pika chat app, including:

  • Color scheme (primary, secondary, accent colors)
  • Typography (font families, sizes, weights)
  • Spacing and padding
  • Border radius
  • Shadows and elevations

Override theme variables in your component:

<style>
:global(.my-custom-button) {
--primary: 220 100% 50%;
--primary-foreground: 0 0% 100%;
}
</style>

Enhanced tooltip with additional features:

<script lang="ts">
import TooltipPlus from 'pika-ux/pika/tooltip-plus/tooltip-plus.svelte';
</script>
<TooltipPlus text="This is a helpful tooltip">
<Button>Hover me</Button>
</TooltipPlus>

Collapsible content container:

<script lang="ts">
import ExpandableContainer from 'pika-ux/pika/expandable-container/expandable-container.svelte';
</script>
<ExpandableContainer
title="Click to expand"
initiallyExpanded={false}
>
<p>This content is hidden by default.</p>
<p>Click the title to reveal it.</p>
</ExpandableContainer>

All shadcn/ui components include:

  • Keyboard navigation - Full keyboard support
  • Screen reader support - Proper ARIA labels and roles
  • Focus management - Clear focus indicators
  • Color contrast - WCAG AA compliant colors
  • Semantic HTML - Proper element usage

All components are fully typed:

import type { Button } from 'pika-ux/shadcn/button';
import type { DialogProps } from 'pika-ux/shadcn/dialog';
// Component props are typed
const buttonProps: ComponentProps<typeof Button> = {
variant: 'default',
size: 'lg',
onclick: () => console.log('clicked')
};

Build complex UIs by composing components:

<Card.Root class="w-96">
<Card.Header>
<Card.Title>User Profile</Card.Title>
</Card.Header>
<Card.Content class="space-y-4">
<div class="space-y-2">
<Label for="name">Name</Label>
<Input id="name" placeholder="Enter your name" />
</div>
<div class="space-y-2">
<Label for="email">Email</Label>
<Input id="email" type="email" placeholder="Enter your email" />
</div>
<div class="flex items-center space-x-2">
<Checkbox id="newsletter" />
<Label for="newsletter">Subscribe to newsletter</Label>
</div>
</Card.Content>
<Card.Footer>
<Button class="w-full">Save Profile</Button>
</Card.Footer>
</Card.Root>

Ensure you have the correct imports and Svelte version:

Terminal window
npm install svelte@^5.0.0 pika-ux

Make sure Tailwind CSS is configured:

tailwind.config.js
export default {
content: [
'./src/**/*.{html,js,svelte,ts}',
'./node_modules/pika-ux/**/*.{html,js,svelte,ts}'
],
// ...
};

Ensure you're using TypeScript 5.0 or higher:

Terminal window
npm install -D typescript@^5.0.0
pika-uxSvelteTypeScriptTailwind
1.x^5.0.0^5.0.0^3.4.0

View components on GitHub: