Getting Started
Components
- Accordion
- Advanced Toast
- AlertMessage
- ArrowButton
- Arrows
- Avatar
- Backdrop
- Basic Toast
- Breadcrumb
- Button
- CardBackground
- Card
- Carousel
- Chapters
- ChatBody
- ChatButton
- ChatHeader
- ChatInput
- ChatMessageActions
- ChatMessageEditor
- ChatMessage
- ChatTypingIndicator
- ChatWindowCsatPrompt
- ChatWindowQuote
- ChatWindow
- CheckboxSelect
- Checkbox
- Checkboxes
- Chip
- ChoiceExpander
- Clickable
- ContentReview
- Countdown
- CriteriaDates
- CriteriaParticipants
- CriteriaTransports
- Date Field
- Datepicker
- Dropdown
- ElasticHeight
- ExpandableCard
- ExpandableText
- Filter
- FloatingLabelTextField
- Form Control
- Form Label
- Frame
- HamburgerIcon
- Heading
- Image
- JourneyCard
- LayerHeader
- Layer
- Link
- Loader
- Number Field
- PageNavigation
- Pagination
- Paragraph
- Password
- Phone Field
- Popin
- Portal
- ProductThumbnail
- Promises
- Prose
- Radio Group
- RadioSelect
- Radio
- Range
- Scrollbar
- Select
- SidebarLayout
- SliderFrame
- SparkleWrapper
- Spinner
- Switch
- Table
- Tabs
- Tag
- TextField
- Toggle
- Tooltip
- ValidationMessage
'use client';
import { Filter } from '@/ui/forms/Filter';
import { Icon } from '@clubmed/trident-icons';
export function FilterDemo() {
return (
<Filter checked={false}>
<div className="flex items-center gap-x-8">
<Icon name="Filters" />
Category Filter
</div>
</Filter>
);
}
Installation
npx shadcn@latest add https://develop.trident-ui.pro.clubmed/r/filter.json
Usage
'use client';
import { useState } from 'react';
import { Filter } from '@/docs/lib/ui/forms/filter';
export function Component() {
const [checked, setChecked] = useState(false);
return (
<Filter
name="category"
checked={checked}
onChange={(_, value) => setChecked(value)}
>
Category Filter
</Filter>
);
}API Reference
Filter
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | undefined | Label content displayed next to icons |
hasDropdown | boolean | undefined | Displays a dropdown arrow icon when true |
dataTestId | string | undefined | Deprecated alias for data-testid |
data-testid | string | undefined | Test identifier forwarded to the native input |
className | string | undefined | Additional classes on the outer wrapper |
onChange | (event: Event, value: boolean) => void | undefined | Change handler receiving browser event, checked value |
Filter also supports standard HTML input attributes (checked, defaultChecked, name, value, disabled, etc.).
Notes
- Checkbox-based: Filter is built on a native checkbox input, providing proper semantics and keyboard accessibility out of the box
- Check icon: When checked, displays a check icon (CheckDefault) to indicate the selected state
- Dropdown indicator: Set
hasDropdown={true}to show an arrow icon, useful when the filter opens a dropdown menu - Normalized onChange: Uses the shared forms contract
onChange(event, value) - Composability: Can be used directly inside
Checkboxesfor grouped selection behavior - Disabled state: When disabled, prevents clicks and keyboard interactions
- Data attributes: Includes
data-name="Filter"for styling anddata-testidfor testing - Keyboard support: Fully keyboard accessible with configurable
tabIndex