Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
Shared
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Hooks
Resources
useBreakpoint
Current Tailwind breakpoint with min/max helpers.
A React hook that tracks the active breakpoint from window.innerWidth. Returns the breakpoint name and ships useIsMinBreakpoint / useIsMaxBreakpoint helpers for comparisons.
Installation
pnpm dlx shadcn@latest add @frontal-labs/use-breakpoint
Usage
Current breakpoint
import { useBreakpoint } from "@/hooks/use-breakpoint";
function Badge() {
const breakpoint = useBreakpoint(); // "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl"
return <span>{breakpoint}</span>;
}Min / max comparisons
import { useIsMaxBreakpoint, useIsMinBreakpoint } from "@/hooks/use-breakpoint";
function Layout() {
const isDesktop = useIsMinBreakpoint("lg");
const isSmall = useIsMaxBreakpoint("sm");
return isDesktop ? <DesktopNav /> : <MobileNav />;
}API
function useBreakpoint(): Breakpoint;
function useIsMinBreakpoint(breakpoint: Breakpoint): boolean;
function useIsMaxBreakpoint(breakpoint: Breakpoint): boolean;Return values
| Hook | Type | Description |
|---|---|---|
useBreakpoint | Breakpoint | Active breakpoint name derived from window.innerWidth. Defaults to "sm" before mount. |
useIsMinBreakpoint | boolean | true when the current breakpoint is at or above the given one. |
useIsMaxBreakpoint | boolean | true when the current breakpoint is at or below the given one. |
Breakpoints resolve against the shared BREAKPOINTS map from use-media-query (sm: 640, md: 800, lg: 1024, xl: 1280, 2xl: 1536, 3xl: 1600, 4xl: 2000).