Compare commits

...

11 Commits

Author SHA1 Message Date
shadcn
ff1586b733 perf: optimize build-registry script for ~3.4x faster builds
- Add parallel style building with concurrency limiter (6 concurrent)
- Cache registry imports to avoid duplicate validations
- Pre-load all style maps in parallel
- Process files within each style concurrently
- Batch prettier formatting into single call at end
- Parallelize cleanup of temp files and directories
- Parallelize RTL example generation
- Add build timing output

Reduces build time from ~33s to ~10s.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:59:36 +04:00
shadcn
858388d64a fix 2026-01-25 10:34:00 +04:00
shadcn
e27b6838ee fix 2026-01-23 22:12:33 +04:00
shadcn
4c58d7701a Merge branch 'main' into shadcn/rtl
# Conflicts:
#	apps/v4/examples/base/ui/combobox.tsx
#	apps/v4/examples/base/ui/context-menu.tsx
#	apps/v4/examples/base/ui/dropdown-menu.tsx
#	apps/v4/examples/base/ui/hover-card.tsx
#	apps/v4/examples/base/ui/menubar.tsx
#	apps/v4/examples/base/ui/popover.tsx
#	apps/v4/examples/base/ui/select.tsx
#	apps/v4/examples/base/ui/tooltip.tsx
#	apps/v4/examples/radix/ui/menubar.tsx
#	apps/v4/examples/radix/ui/select.tsx
#	apps/v4/public/r/styles/base-lyra/context-menu.json
#	apps/v4/public/r/styles/base-lyra/dropdown-menu.json
#	apps/v4/public/r/styles/base-lyra/hover-card.json
#	apps/v4/public/r/styles/base-lyra/popover.json
#	apps/v4/public/r/styles/base-lyra/tooltip-example.json
#	apps/v4/public/r/styles/base-lyra/tooltip.json
#	apps/v4/public/r/styles/base-maia/context-menu.json
#	apps/v4/public/r/styles/base-maia/dropdown-menu.json
#	apps/v4/public/r/styles/base-maia/hover-card.json
#	apps/v4/public/r/styles/base-maia/popover.json
#	apps/v4/public/r/styles/base-maia/tooltip-example.json
#	apps/v4/public/r/styles/base-maia/tooltip.json
#	apps/v4/public/r/styles/base-mira/context-menu.json
#	apps/v4/public/r/styles/base-mira/dropdown-menu.json
#	apps/v4/public/r/styles/base-mira/hover-card.json
#	apps/v4/public/r/styles/base-mira/popover.json
#	apps/v4/public/r/styles/base-mira/tooltip-example.json
#	apps/v4/public/r/styles/base-mira/tooltip.json
#	apps/v4/public/r/styles/base-nova/context-menu.json
#	apps/v4/public/r/styles/base-nova/dropdown-menu.json
#	apps/v4/public/r/styles/base-nova/hover-card.json
#	apps/v4/public/r/styles/base-nova/popover.json
#	apps/v4/public/r/styles/base-nova/tooltip-example.json
#	apps/v4/public/r/styles/base-nova/tooltip.json
#	apps/v4/public/r/styles/base-vega/context-menu.json
#	apps/v4/public/r/styles/base-vega/dropdown-menu.json
#	apps/v4/public/r/styles/base-vega/hover-card.json
#	apps/v4/public/r/styles/base-vega/popover.json
#	apps/v4/public/r/styles/base-vega/tooltip-example.json
#	apps/v4/public/r/styles/base-vega/tooltip.json
#	apps/v4/public/r/styles/radix-mira/menubar.json
#	apps/v4/public/r/styles/radix-nova/menubar.json
#	apps/v4/registry/bases/base/examples/tooltip-example.tsx
#	apps/v4/registry/bases/base/ui/hover-card.tsx
#	apps/v4/registry/bases/base/ui/popover.tsx
#	apps/v4/registry/bases/base/ui/tooltip.tsx
2026-01-23 21:15:31 +04:00
shadcn
265953771f fix 2026-01-23 11:13:54 +04:00
shadcn
6f0abe445a Merge branch 'main' into shadcn/rtl
# Conflicts:
#	apps/v4/examples/base/ui/sidebar.tsx
#	apps/v4/examples/radix/ui/sidebar.tsx
#	apps/v4/public/r/styles/base-lyra/sidebar.json
#	apps/v4/public/r/styles/base-maia/sidebar.json
#	apps/v4/public/r/styles/base-mira/sidebar.json
#	apps/v4/public/r/styles/base-nova/sidebar.json
#	apps/v4/public/r/styles/base-vega/sidebar.json
#	apps/v4/public/r/styles/radix-lyra/sidebar.json
#	apps/v4/public/r/styles/radix-maia/sidebar.json
#	apps/v4/public/r/styles/radix-mira/sidebar.json
#	apps/v4/public/r/styles/radix-nova/sidebar.json
#	apps/v4/public/r/styles/radix-vega/sidebar.json
2026-01-22 23:58:56 +04:00
shadcn
5cd0fab0f3 fix 2026-01-22 23:52:02 +04:00
shadcn
ee7c7f4558 Merge branch 'main' into shadcn/rtl
# Conflicts:
#	apps/v4/components/component-preview-tabs.tsx
2026-01-22 22:08:02 +04:00
shadcn
aff6e1ab47 fix 2026-01-22 09:58:18 +04:00
shadcn
5317ae8a70 feat 2026-01-21 13:24:09 +04:00
shadcn
7513f0f894 feat: rtl 2026-01-21 12:30:45 +04:00
481 changed files with 34839 additions and 464 deletions

View File

@@ -11,6 +11,7 @@ import { Separator } from "@/registry/new-york-v4/ui/separator"
import { MenuAccentPicker } from "@/app/(create)/components/accent-picker" import { MenuAccentPicker } from "@/app/(create)/components/accent-picker"
import { BaseColorPicker } from "@/app/(create)/components/base-color-picker" import { BaseColorPicker } from "@/app/(create)/components/base-color-picker"
import { BasePicker } from "@/app/(create)/components/base-picker" import { BasePicker } from "@/app/(create)/components/base-picker"
import { DirectionPicker } from "@/app/(create)/components/direction-picker"
import { FontPicker } from "@/app/(create)/components/font-picker" import { FontPicker } from "@/app/(create)/components/font-picker"
import { IconLibraryPicker } from "@/app/(create)/components/icon-library-picker" import { IconLibraryPicker } from "@/app/(create)/components/icon-library-picker"
import { MenuColorPicker } from "@/app/(create)/components/menu-picker" import { MenuColorPicker } from "@/app/(create)/components/menu-picker"
@@ -38,7 +39,7 @@ export function Customizer() {
className="no-scrollbar -mx-2.5 flex flex-col overflow-y-auto p-1 md:mx-0 md:h-[calc(100svh-var(--header-height)-2rem)] md:w-48 md:gap-0 md:py-0" className="no-scrollbar -mx-2.5 flex flex-col overflow-y-auto p-1 md:mx-0 md:h-[calc(100svh-var(--header-height)-2rem)] md:w-48 md:gap-0 md:py-0"
ref={anchorRef} ref={anchorRef}
> >
<div className="hidden items-center gap-2 px-[calc(--spacing(2.5))] pb-1 md:flex md:flex-col md:items-start"> <div className="--md:flex hidden items-center gap-2 px-[calc(--spacing(2.5))] pb-1 md:flex-col md:items-start">
<HugeiconsIcon <HugeiconsIcon
icon={Settings05Icon} icon={Settings05Icon}
className="size-4" className="size-4"
@@ -75,6 +76,7 @@ export function Customizer() {
<IconLibraryPicker isMobile={isMobile} anchorRef={anchorRef} /> <IconLibraryPicker isMobile={isMobile} anchorRef={anchorRef} />
<FontPicker fonts={FONTS} isMobile={isMobile} anchorRef={anchorRef} /> <FontPicker fonts={FONTS} isMobile={isMobile} anchorRef={anchorRef} />
<RadiusPicker isMobile={isMobile} anchorRef={anchorRef} /> <RadiusPicker isMobile={isMobile} anchorRef={anchorRef} />
<DirectionPicker isMobile={isMobile} anchorRef={anchorRef} />
<MenuColorPicker isMobile={isMobile} anchorRef={anchorRef} /> <MenuColorPicker isMobile={isMobile} anchorRef={anchorRef} />
<MenuAccentPicker isMobile={isMobile} anchorRef={anchorRef} /> <MenuAccentPicker isMobile={isMobile} anchorRef={anchorRef} />
<div className="mt-auto hidden w-full flex-col items-center gap-0 md:flex"> <div className="mt-auto hidden w-full flex-col items-center gap-0 md:flex">

View File

@@ -17,7 +17,7 @@ export function DesignSystemProvider({
children: React.ReactNode children: React.ReactNode
}) { }) {
const [ const [
{ style, theme, font, baseColor, menuAccent, menuColor, radius }, { style, theme, font, baseColor, direction, menuAccent, menuColor, radius },
setSearchParams, setSearchParams,
] = useDesignSystemSearchParams({ ] = useDesignSystemSearchParams({
shallow: true, // No need to go through the server… shallow: true, // No need to go through the server…
@@ -166,6 +166,13 @@ export function DesignSystemProvider({
} }
}, [menuColor]) }, [menuColor])
// Set dir attribute on html element when direction changes.
React.useLayoutEffect(() => {
if (direction) {
document.documentElement.dir = direction
}
}, [direction])
if (!isReady) { if (!isReady) {
return null return null
} }

View File

@@ -0,0 +1,122 @@
"use client"
import * as React from "react"
import { type DirectionValue } from "@/registry/config"
import { LockButton } from "@/app/(create)/components/lock-button"
import {
Picker,
PickerContent,
PickerGroup,
PickerRadioGroup,
PickerRadioItem,
PickerTrigger,
} from "@/app/(create)/components/picker"
import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params"
const DIRECTION_OPTIONS = [
{
value: "ltr" as const,
label: "LTR",
description: "Left-to-Right",
icon: (
<svg
xmlns="http://www.w3.org/2000/svg"
width="128"
height="128"
viewBox="0 0 24 24"
fill="none"
role="img"
stroke="currentColor"
className="text-foreground"
>
<path
d="M3 12h18M15 6l6 6-6 6"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
),
},
{
value: "rtl" as const,
label: "RTL",
description: "Right-to-Left",
icon: (
<svg
xmlns="http://www.w3.org/2000/svg"
width="128"
height="128"
viewBox="0 0 24 24"
fill="none"
role="img"
stroke="currentColor"
className="text-foreground"
>
<path
d="M21 12H3M9 18l-6-6 6-6"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
),
},
] as const
export function DirectionPicker({
isMobile,
anchorRef,
}: {
isMobile: boolean
anchorRef: React.RefObject<HTMLDivElement | null>
}) {
const [params, setParams] = useDesignSystemSearchParams()
const currentDirection = DIRECTION_OPTIONS.find(
(direction) => direction.value === params.direction
)
return (
<div className="group/picker relative">
<Picker>
<PickerTrigger>
<div className="flex flex-col justify-start text-left">
<div className="text-muted-foreground text-xs">Direction</div>
<div className="text-foreground text-sm font-medium">
{currentDirection?.label}
</div>
</div>
<div className="text-foreground pointer-events-none absolute top-1/2 right-4 flex size-4 -translate-y-1/2 items-center justify-center text-base select-none">
{currentDirection?.icon}
</div>
</PickerTrigger>
<PickerContent
anchor={isMobile ? anchorRef : undefined}
side={isMobile ? "top" : "right"}
align={isMobile ? "center" : "start"}
>
<PickerRadioGroup
value={currentDirection?.value}
onValueChange={(value) => {
setParams({ direction: value as DirectionValue })
}}
>
<PickerGroup>
{DIRECTION_OPTIONS.map((direction) => (
<PickerRadioItem key={direction.value} value={direction.value}>
{direction.icon}
{direction.label}
</PickerRadioItem>
))}
</PickerGroup>
</PickerRadioGroup>
</PickerContent>
</Picker>
<LockButton
param="direction"
className="absolute top-1/2 right-10 -translate-y-1/2"
/>
</div>
)
}

View File

@@ -11,6 +11,7 @@ export type LockableParam =
| "menuAccent" | "menuAccent"
| "menuColor" | "menuColor"
| "radius" | "radius"
| "direction"
type LocksContextValue = { type LocksContextValue = {
locks: Set<LockableParam> locks: Set<LockableParam>

View File

@@ -14,6 +14,7 @@ import {
BASE_COLORS, BASE_COLORS,
BASES, BASES,
DEFAULT_CONFIG, DEFAULT_CONFIG,
DIRECTIONS,
iconLibraries, iconLibraries,
MENU_ACCENTS, MENU_ACCENTS,
MENU_COLORS, MENU_COLORS,
@@ -22,6 +23,7 @@ import {
THEMES, THEMES,
type BaseColorName, type BaseColorName,
type BaseName, type BaseName,
type DirectionValue,
type FontValue, type FontValue,
type IconLibraryName, type IconLibraryName,
type MenuAccentValue, type MenuAccentValue,
@@ -52,6 +54,9 @@ const designSystemSearchParams = {
baseColor: parseAsStringLiteral<BaseColorName>( baseColor: parseAsStringLiteral<BaseColorName>(
BASE_COLORS.map((b) => b.name) BASE_COLORS.map((b) => b.name)
).withDefault(DEFAULT_CONFIG.baseColor), ).withDefault(DEFAULT_CONFIG.baseColor),
direction: parseAsStringLiteral<DirectionValue>(
DIRECTIONS.map((d) => d.value)
).withDefault(DEFAULT_CONFIG.direction),
menuAccent: parseAsStringLiteral<MenuAccentValue>( menuAccent: parseAsStringLiteral<MenuAccentValue>(
MENU_ACCENTS.map((a) => a.value) MENU_ACCENTS.map((a) => a.value)
).withDefault(DEFAULT_CONFIG.menuAccent), ).withDefault(DEFAULT_CONFIG.menuAccent),

View File

@@ -1,9 +1,18 @@
"use client" "use client"
import * as React from "react" import * as React from "react"
import { Button } from "@/examples/base/ui/button"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import {
LanguageProvider,
LanguageSelector,
useLanguageContext,
useTranslation,
type Translations,
} from "@/components/language-selector"
import { DirectionProvider as BaseDirectionProvider } from "@/registry/bases/base/ui/direction"
import { DirectionProvider as RadixDirectionProvider } from "@/registry/bases/radix/ui/direction"
import { Button } from "@/registry/new-york-v4/ui/button"
export function ComponentPreviewTabs({ export function ComponentPreviewTabs({
className, className,
@@ -14,6 +23,8 @@ export function ComponentPreviewTabs({
component, component,
source, source,
sourcePreview, sourcePreview,
direction = "ltr",
styleName,
...props ...props
}: React.ComponentProps<"div"> & { }: React.ComponentProps<"div"> & {
previewClassName?: string previewClassName?: string
@@ -23,8 +34,11 @@ export function ComponentPreviewTabs({
component: React.ReactNode component: React.ReactNode
source: React.ReactNode source: React.ReactNode
sourcePreview?: React.ReactNode sourcePreview?: React.ReactNode
direction?: "ltr" | "rtl"
styleName?: string
}) { }) {
const [isMobileCodeVisible, setIsMobileCodeVisible] = React.useState(false) const [isMobileCodeVisible, setIsMobileCodeVisible] = React.useState(false)
const base = styleName?.split("-")[0]
return ( return (
<div <div
@@ -35,53 +49,153 @@ export function ComponentPreviewTabs({
)} )}
{...props} {...props}
> >
<div data-slot="preview"> {direction === "rtl" ? (
<div <LanguageProvider defaultLanguage="ar">
data-align={align} <RtlLanguageSelector />
data-chromeless={chromeLessOnMobile} <PreviewWrapper
className={cn( align={align}
"preview flex h-72 w-full justify-center p-10 data-[align=center]:items-center data-[align=end]:items-end data-[align=start]:items-start data-[chromeless=true]:h-auto data-[chromeless=true]:p-0", chromeLessOnMobile={chromeLessOnMobile}
previewClassName previewClassName={previewClassName}
)}
>
{component}
</div>
{!hideCode && (
<div
data-slot="code"
data-mobile-code-visible={isMobileCodeVisible}
className="relative overflow-hidden [&_[data-rehype-pretty-code-figure]]:!m-0 [&_[data-rehype-pretty-code-figure]]:rounded-t-none [&_[data-rehype-pretty-code-figure]]:border-t [&_pre]:max-h-72"
> >
{isMobileCodeVisible ? ( <DirectionProviderWrapper base={base}>
source {component}
) : ( </DirectionProviderWrapper>
<div className="relative"> </PreviewWrapper>
{sourcePreview} </LanguageProvider>
<div className="absolute inset-0 flex items-center justify-center pb-4"> ) : (
<div <DirectionProviderWrapper base={base} dir="ltr">
className="absolute inset-0" <PreviewWrapper
style={{ align={align}
background: chromeLessOnMobile={chromeLessOnMobile}
"linear-gradient(to top, var(--color-code), color-mix(in oklab, var(--color-code) 60%, transparent), transparent)", previewClassName={previewClassName}
}} dir="ltr"
/> >
<Button {component}
type="button" </PreviewWrapper>
size="sm" </DirectionProviderWrapper>
variant="outline" )}
className="bg-background text-foreground dark:bg-background dark:text-foreground hover:bg-muted dark:hover:bg-muted relative z-10" {!hideCode && (
onClick={() => { <div
setIsMobileCodeVisible(true) data-slot="code"
}} data-mobile-code-visible={isMobileCodeVisible}
> className="relative overflow-hidden [&_[data-rehype-pretty-code-figure]]:!m-0 [&_[data-rehype-pretty-code-figure]]:rounded-t-none [&_[data-rehype-pretty-code-figure]]:border-t [&_pre]:max-h-72"
View Code >
</Button> {isMobileCodeVisible ? (
</div> source
) : (
<div className="relative">
{sourcePreview}
<div className="absolute inset-0 flex items-center justify-center pb-4">
<div
className="absolute inset-0"
style={{
background:
"linear-gradient(to top, var(--color-code), color-mix(in oklab, var(--color-code) 60%, transparent), transparent)",
}}
/>
<Button
type="button"
size="sm"
variant="outline"
className="bg-background text-foreground dark:bg-background dark:text-foreground hover:bg-muted dark:hover:bg-muted relative z-10"
onClick={() => {
setIsMobileCodeVisible(true)
}}
>
View Code
</Button>
</div> </div>
)} </div>
</div> )}
</div>
)}
</div>
)
}
const directionTranslations: Translations<Record<string, never>> = {
en: {
dir: "ltr",
values: {},
},
ar: {
dir: "rtl",
values: {},
},
he: {
dir: "rtl",
values: {},
},
}
function RtlLanguageSelector() {
const context = useLanguageContext()
// This component is always rendered inside LanguageProvider when direction === "rtl".
// so context should always be available.
if (!context) {
return null
}
return (
<LanguageSelector
value={context.language}
onValueChange={context.setLanguage}
/>
)
}
function PreviewWrapper({
align,
chromeLessOnMobile,
previewClassName,
dir: explicitDir,
children,
}: {
align: "center" | "start" | "end"
chromeLessOnMobile: boolean
previewClassName?: string
dir?: "ltr" | "rtl"
children: React.ReactNode
}) {
// useTranslation handles the case when there's no LanguageProvider context.
// It will fall back to local state with defaultLanguage.
const translation = useTranslation(directionTranslations, "ar")
const dir = explicitDir ?? translation.dir
return (
<div data-slot="preview" dir={dir}>
<div
data-align={align}
data-chromeless={chromeLessOnMobile}
className={cn(
"preview relative flex h-72 w-full justify-center p-10 data-[align=center]:items-center data-[align=end]:items-end data-[align=start]:items-start data-[chromeless=true]:h-auto data-[chromeless=true]:p-0",
previewClassName
)} )}
>
{children}
</div> </div>
</div> </div>
) )
} }
function DirectionProviderWrapper({
base,
dir: explicitDir,
children,
}: {
base?: string
dir?: "ltr" | "rtl"
children: React.ReactNode
}) {
// useTranslation handles the case when there's no LanguageProvider context.
// It will fall back to local state with defaultLanguage.
const translation = useTranslation(directionTranslations, "ar")
const dir = explicitDir ?? translation.dir
if (base === "base") {
return (
<BaseDirectionProvider direction={dir}>{children}</BaseDirectionProvider>
)
}
return <RadixDirectionProvider dir={dir}>{children}</RadixDirectionProvider>
}

View File

@@ -14,6 +14,8 @@ export function ComponentPreview({
hideCode = false, hideCode = false,
chromeLessOnMobile = false, chromeLessOnMobile = false,
styleName = "new-york-v4", styleName = "new-york-v4",
direction = "ltr",
caption,
...props ...props
}: React.ComponentProps<"div"> & { }: React.ComponentProps<"div"> & {
name: string name: string
@@ -24,9 +26,18 @@ export function ComponentPreview({
type?: "block" | "component" | "example" type?: "block" | "component" | "example"
chromeLessOnMobile?: boolean chromeLessOnMobile?: boolean
previewClassName?: string previewClassName?: string
direction?: "ltr" | "rtl"
caption?: string
}) { }) {
const translationDisclaimer =
direction === "rtl"
? "Automatic translation may contain errors."
: undefined
const finalCaption =
[caption, translationDisclaimer].filter(Boolean).join(" ") || undefined
if (type === "block") { if (type === "block") {
return ( const content = (
<div className="relative aspect-[4/2.5] w-full overflow-hidden rounded-xl border md:-mx-1"> <div className="relative aspect-[4/2.5] w-full overflow-hidden rounded-xl border md:-mx-1">
<Image <Image
src={`/r/styles/new-york-v4/${name}-light.png`} src={`/r/styles/new-york-v4/${name}-light.png`}
@@ -47,6 +58,19 @@ export function ComponentPreview({
</div> </div>
</div> </div>
) )
if (finalCaption) {
return (
<figure className="flex flex-col gap-4">
{content}
<figcaption className="text-muted-foreground text-center text-sm">
{finalCaption}
</figcaption>
</figure>
)
}
return content
} }
const Component = getRegistryComponent(name, styleName) const Component = getRegistryComponent(name, styleName)
@@ -63,7 +87,7 @@ export function ComponentPreview({
) )
} }
return ( const content = (
<ComponentPreviewTabs <ComponentPreviewTabs
className={className} className={className}
previewClassName={previewClassName} previewClassName={previewClassName}
@@ -86,9 +110,27 @@ export function ComponentPreview({
/> />
} }
chromeLessOnMobile={chromeLessOnMobile} chromeLessOnMobile={chromeLessOnMobile}
direction={direction}
styleName={styleName}
{...props} {...props}
/> />
) )
if (finalCaption) {
return (
<figure
data-hide-code={hideCode}
className="flex flex-col data-[hide-code=true]:gap-4"
>
{content}
<figcaption className="text-muted-foreground -mt-8 text-center text-sm data-[hide-code=true]:mt-0">
{finalCaption}
</figcaption>
</figure>
)
}
return content
} }
function DynamicComponent({ function DynamicComponent({

View File

@@ -32,6 +32,10 @@ const TOP_LEVEL_SECTIONS = [
name: "Directory", name: "Directory",
href: "/docs/directory", href: "/docs/directory",
}, },
{
name: "RTL",
href: "/docs/rtl",
},
{ {
name: "MCP Server", name: "MCP Server",
href: "/docs/mcp", href: "/docs/mcp",
@@ -91,6 +95,12 @@ export function DocsSidebar({
<Link href={href}> <Link href={href}>
<span className="absolute inset-0 flex w-(--sidebar-width) bg-transparent" /> <span className="absolute inset-0 flex w-(--sidebar-width) bg-transparent" />
{name} {name}
{PAGES_NEW.includes(href) && (
<span
className="flex size-2 rounded-full bg-blue-500"
title="New"
/>
)}
</Link> </Link>
</SidebarMenuButton> </SidebarMenuButton>
</SidebarMenuItem> </SidebarMenuItem>

View File

@@ -0,0 +1,119 @@
"use client"
import * as React from "react"
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/examples/base/ui/select"
import { cn } from "@/lib/utils"
export type Language = "en" | "ar" | "he"
export type Direction = "ltr" | "rtl"
export type Translations<
T extends Record<string, string> = Record<string, string>,
> = Record<
Language,
{
dir: Direction
values: T
}
>
export const languageOptions = [
{ value: "en", label: "English" },
{ value: "ar", label: "Arabic (العربية)" },
{ value: "he", label: "Hebrew (עברית)" },
] as const
type LanguageContextType = {
language: Language
setLanguage: (language: Language) => void
}
const LanguageContext = React.createContext<LanguageContextType | undefined>(
undefined
)
export function LanguageProvider({
children,
defaultLanguage = "ar",
}: {
children: React.ReactNode
defaultLanguage?: Language
}) {
const [language, setLanguage] = React.useState<Language>(defaultLanguage)
return (
<LanguageContext.Provider value={{ language, setLanguage }}>
{children}
</LanguageContext.Provider>
)
}
export function useLanguageContext() {
const context = React.useContext(LanguageContext)
return context
}
export function useTranslation<T extends Record<string, string>>(
translations: Translations<T>,
defaultLanguage: Language = "ar"
) {
const context = useLanguageContext()
const [localLanguage, setLocalLanguage] =
React.useState<Language>(defaultLanguage)
const language = context?.language ?? localLanguage
const setLanguage = context?.setLanguage ?? setLocalLanguage
const { dir, values: t } = translations[language]
return { language, setLanguage, dir, t }
}
export interface LanguageSelectorProps {
value: Language
onValueChange: (value: Language) => void
}
export function LanguageSelector({
value,
onValueChange,
className,
}: LanguageSelectorProps & {
className?: string
}) {
return (
<Select
items={languageOptions}
value={value}
onValueChange={(value) => onValueChange(value as Language)}
>
<SelectTrigger
size="sm"
className={cn("absolute top-4 right-4 z-50 w-36", className)}
dir="ltr"
>
<SelectValue />
</SelectTrigger>
<SelectContent
dir="ltr"
className="data-closed:animate-none data-open:animate-none"
>
<SelectGroup>
{languageOptions.map((option) => (
<SelectItem key={option.value} value={option.value}>
{option.label}
</SelectItem>
))}
</SelectGroup>
</SelectContent>
</Select>
)
}

View File

@@ -30,6 +30,10 @@ const TOP_LEVEL_SECTIONS = [
name: "Directory", name: "Directory",
href: "/docs/directory", href: "/docs/directory",
}, },
{
name: "RTL",
href: "/docs/rtl",
},
{ {
name: "MCP Server", name: "MCP Server",
href: "/docs/mcp", href: "/docs/mcp",

View File

@@ -6,6 +6,7 @@
"components-json", "components-json",
"theming", "theming",
"[Dark Mode](/docs/dark-mode)", "[Dark Mode](/docs/dark-mode)",
"[RTL](/docs/rtl)",
"[CLI](/docs/cli)", "[CLI](/docs/cli)",
"monorepo", "monorepo",
"typography", "typography",

View File

@@ -0,0 +1,94 @@
---
title: "RTL"
description: "RTL documentation"
---
## Overview
RTL is a feature that allows you to display content from right to left.
## Sidebar
If you have an existing `sidebar.tsx` component and want to make it RTL compatible, you'll need to make the following changes:
### 1. Update the side prop type and default
```tsx
function Sidebar({
side = "inline-start", // [!code highlight]
variant = "sidebar",
collapsible = "offcanvas",
className,
children,
...props
}: React.ComponentProps<"div"> & {
side?: "left" | "right" | "inline-start" | "inline-end" // [!code highlight]
variant?: "sidebar" | "floating" | "inset"
collapsible?: "offcanvas" | "icon" | "none"
}) {
```
### 2. Update the mobile Sheet side prop
The Sheet component only accepts physical `left` or `right` values, so map the logical values:
```tsx
<SheetContent
side={side === "inline-start" || side === "left" ? "left" : "right"}
// ...
>
```
### 3. Normalize the data-side attribute
The `data-side` attribute is used by CSS selectors, so normalize it to physical values:
```tsx
<div
data-side={side === "inline-start" || side === "left" ? "left" : "right"}
// ...
>
```
### 4. Update the sidebar container positioning
Change the conditional logic to include `inline-start` and use logical positioning classes:
```tsx
className={cn(
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex",
side === "left" || side === "inline-start"
? "start-0 group-data-[collapsible=offcanvas]:start-[calc(var(--sidebar-width)*-1)]"
: "end-0 group-data-[collapsible=offcanvas]:end-[calc(var(--sidebar-width)*-1)]",
// ...
)}
```
### 5. Update SidebarRail classes
Replace physical positioning classes with logical equivalents:
| Before | After |
| --------------------------------- | --------------------------------- |
| `group-data-[side=left]:-right-4` | `group-data-[side=left]:-end-4` |
| `group-data-[side=right]:left-0` | `group-data-[side=right]:start-0` |
| `after:left-1/2` | `after:start-1/2` |
| `after:left-full` | `after:start-full` |
| `-right-2` | `-end-2` |
| `-left-2` | `-start-2` |
### Usage
After these changes, you can use the sidebar with logical side values:
```tsx
// LTR: sidebar on the left, RTL: sidebar on the right
<Sidebar side="inline-start" />
// LTR: sidebar on the right, RTL: sidebar on the left
<Sidebar side="inline-end" />
// Physical values still work for explicit positioning
<Sidebar side="left" />
<Sidebar side="right" />
```

View File

@@ -137,6 +137,17 @@ Wrap the `Accordion` in a `Card` component.
previewClassName="*:data-[slot=accordion]:max-w-sm h-[435px]" previewClassName="*:data-[slot=accordion]:max-w-sm h-[435px]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="accordion-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
See the [Base UI](https://base-ui.com/react/components/accordion#api-reference) documentation for more information. See the [Base UI](https://base-ui.com/react/components/accordion#api-reference) documentation for more information.

View File

@@ -146,6 +146,17 @@ Use the `AlertDialogAction` component to add a destructive action button to the
previewClassName="h-56" previewClassName="h-56"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="alert-dialog-rtl"
direction="rtl"
previewClassName="h-56"
/>
## API Reference ## API Reference
### size ### size

View File

@@ -109,6 +109,17 @@ You can customize the alert colors by adding custom classes such as `bg-amber-50
previewClassName="h-auto sm:h-72 p-6" previewClassName="h-auto sm:h-72 p-6"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="alert-rtl"
direction="rtl"
previewClassName="h-auto sm:h-72 p-6"
/>
## API Reference ## API Reference
### Alert ### Alert

View File

@@ -79,6 +79,17 @@ A portrait aspect ratio component using the `ratio={9 / 16}` prop. This is usefu
previewClassName="h-96" previewClassName="h-96"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="aspect-ratio-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
### AspectRatio ### AspectRatio

View File

@@ -129,6 +129,17 @@ You can use the `Avatar` component as a trigger for a dropdown menu.
<ComponentPreview styleName="base-nova" name="avatar-dropdown" /> <ComponentPreview styleName="base-nova" name="avatar-dropdown" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="avatar-rtl"
direction="rtl"
previewClassName="h-72"
/>
## API Reference ## API Reference
### Avatar ### Avatar

View File

@@ -85,6 +85,12 @@ You can customize the colors of a badge by adding custom classes such as `bg-gre
<ComponentPreview styleName="base-nova" name="badge-colors" /> <ComponentPreview styleName="base-nova" name="badge-colors" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="badge-rtl" direction="rtl" />
## API Reference ## API Reference
### Badge ### Badge

View File

@@ -116,6 +116,17 @@ To use a custom link component from your routing library, you can use the `rende
<ComponentPreview styleName="base-nova" name="breadcrumb-link" /> <ComponentPreview styleName="base-nova" name="breadcrumb-link" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="breadcrumb-rtl"
direction="rtl"
previewClassName="p-2"
/>
## API Reference ## API Reference
### Breadcrumb ### Breadcrumb

View File

@@ -148,6 +148,16 @@ Use with a `Popover` component.
<ComponentPreview styleName="base-nova" name="button-group-popover" /> <ComponentPreview styleName="base-nova" name="button-group-popover" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="button-group-rtl"
direction="rtl"
/>
## API Reference ## API Reference
### ButtonGroup ### ButtonGroup

View File

@@ -143,6 +143,12 @@ Remember to set the `nativeButton` prop to `false` if you're returning an elemen
<ComponentPreview styleName="base-nova" name="button-render" /> <ComponentPreview styleName="base-nova" name="button-render" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="button-rtl" direction="rtl" />
## API Reference ## API Reference
### Button ### Button

View File

@@ -501,6 +501,17 @@ npx shadcn@latest add calendar-02
This will install the latest version of the calendar blocks. This will install the latest version of the calendar blocks.
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="calendar-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
See the [React DayPicker](https://react-day-picker.js.org) documentation for more information on the `Calendar` component API. See the [React DayPicker](https://react-day-picker.js.org) documentation for more information on the `Calendar` component API.

View File

@@ -99,6 +99,17 @@ Add an image before the card header to create a card with an image.
previewClassName="h-[32rem]" previewClassName="h-[32rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="card-rtl"
direction="rtl"
previewClassName="h-[30rem]"
/>
## API Reference ## API Reference
### Card ### Card

View File

@@ -285,6 +285,17 @@ export function Example() {
previewClassName="sm:h-[32rem]" previewClassName="sm:h-[32rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="carousel-rtl"
direction="rtl"
previewClassName="h-80 sm:h-[32rem]"
/>
## API Reference ## API Reference
See the [Embla Carousel docs](https://www.embla-carousel.com/api/plugins/) for more information on props and plugins. See the [Embla Carousel docs](https://www.embla-carousel.com/api/plugins/) for more information on props and plugins.

View File

@@ -122,6 +122,17 @@ Use multiple fields to create a checkbox list.
previewClassName="p-4 md:p-8" previewClassName="p-4 md:p-8"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="checkbox-rtl"
direction="rtl"
previewClassName="h-80"
/>
## API Reference ## API Reference
See the [Base UI](https://base-ui.com/react/components/checkbox#api-reference) documentation for more information. See the [Base UI](https://base-ui.com/react/components/checkbox#api-reference) documentation for more information.

View File

@@ -118,6 +118,16 @@ Use nested collapsibles to build a file tree.
previewClassName="h-[36rem]" previewClassName="h-[36rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="collapsible-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Base UI](https://base-ui.com/react/components/collapsible#api-reference) documentation for more information. See the [Base UI](https://base-ui.com/react/components/collapsible#api-reference) documentation for more information.

View File

@@ -256,6 +256,12 @@ You can add an addon to the combobox by using the `InputGroupAddon` component in
<ComponentPreview styleName="base-nova" name="combobox-input-group" /> <ComponentPreview styleName="base-nova" name="combobox-input-group" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="combobox-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI](https://base-ui.com/react/components/combobox#api-reference) documentation for more information. See the [Base UI](https://base-ui.com/react/components/combobox#api-reference) documentation for more information.

View File

@@ -120,6 +120,18 @@ Scrollable command menu with multiple items.
<ComponentPreview styleName="base-nova" name="command-scrollable" /> <ComponentPreview styleName="base-nova" name="command-scrollable" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="command-rtl"
direction="rtl"
align="start"
previewClassName="h-[24.5rem]"
/>
## API Reference ## API Reference
See the [cmdk](https://github.com/dip/cmdk) documentation for more information. See the [cmdk](https://github.com/dip/cmdk) documentation for more information.

View File

@@ -135,6 +135,16 @@ Control submenu placement with side and align props.
<ComponentPreview styleName="base-nova" name="context-menu-sides" /> <ComponentPreview styleName="base-nova" name="context-menu-sides" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="context-menu-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Base UI](https://base-ui.com/react/components/context-menu#api-reference) documentation for more information. See the [Base UI](https://base-ui.com/react/components/context-menu#api-reference) documentation for more information.

View File

@@ -95,3 +95,13 @@ A date picker component with a time input field for selecting a time.
This component uses the `chrono-node` library to parse natural language dates. This component uses the `chrono-node` library to parse natural language dates.
<ComponentPreview styleName="base-nova" name="date-picker-natural-language" /> <ComponentPreview styleName="base-nova" name="date-picker-natural-language" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="date-picker-rtl"
direction="rtl"
/>

View File

@@ -111,6 +111,12 @@ Long content can scroll while the header stays in view.
<ComponentPreview styleName="base-nova" name="dialog-scrollable-content" /> <ComponentPreview styleName="base-nova" name="dialog-scrollable-content" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="dialog-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI](https://base-ui.com/react/components/dialog#api-reference) documentation for more information. See the [Base UI](https://base-ui.com/react/components/dialog#api-reference) documentation for more information.

View File

@@ -108,6 +108,12 @@ You can combine the `Dialog` and `Drawer` components to create a responsive dial
<ComponentPreview styleName="base-nova" name="drawer-dialog" /> <ComponentPreview styleName="base-nova" name="drawer-dialog" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="drawer-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Vaul documentation](https://vaul.emilkowal.ski/getting-started) for the full API reference. See the [Vaul documentation](https://vaul.emilkowal.ski/getting-started) for the full API reference.

View File

@@ -160,6 +160,16 @@ A richer example combining groups, icons, and submenus.
<ComponentPreview styleName="base-nova" name="dropdown-menu-complex" /> <ComponentPreview styleName="base-nova" name="dropdown-menu-complex" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="dropdown-menu-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Base UI documentation](https://base-ui.com/react/components/dropdown-menu) for the full API reference. See the [Base UI documentation](https://base-ui.com/react/components/dropdown-menu) for the full API reference.

View File

@@ -127,6 +127,12 @@ You can add an `InputGroup` component to the `EmptyContent` component.
previewClassName="h-96 p-0" previewClassName="h-96 p-0"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="empty-rtl" direction="rtl" />
## API Reference ## API Reference
### Empty ### Empty

View File

@@ -162,6 +162,17 @@ Stack `Field` components with `FieldGroup`. Add `FieldSeparator` to divide them.
previewClassName="h-96" previewClassName="h-96"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="field-rtl"
direction="rtl"
previewClassName="h-[800px] p-6 md:h-[850px]"
/>
## Responsive Layout ## Responsive Layout
- **Vertical fields:** Default orientation stacks label, control, and helper text—ideal for mobile-first layouts. - **Vertical fields:** Default orientation stacks label, control, and helper text—ideal for mobile-first layouts.

View File

@@ -120,6 +120,17 @@ Use the `side` and `align` props on `HoverCardContent` to control placement.
previewClassName="h-[22rem]" previewClassName="h-[22rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="hover-card-rtl"
direction="rtl"
previewClassName="h-80"
/>
## API Reference ## API Reference
See the [Base UI](https://base-ui.com/react/components/hover-card#api-reference) documentation for more information. See the [Base UI](https://base-ui.com/react/components/hover-card#api-reference) documentation for more information.

View File

@@ -191,6 +191,17 @@ Here's an example of a custom resizable textarea from a third-party library.
previewClassName="h-56" previewClassName="h-56"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="input-group-rtl"
direction="rtl"
previewClassName="h-[30rem]"
/>
## API Reference ## API Reference
### InputGroup ### InputGroup

View File

@@ -142,6 +142,12 @@ Use `REGEXP_ONLY_DIGITS_AND_CHARS` to accept both letters and numbers.
previewClassName="h-[30rem]" previewClassName="h-[30rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="input-otp-rtl" direction="rtl" />
## API Reference ## API Reference
See the [input-otp](https://input-otp.rodz.dev) documentation for more information. See the [input-otp](https://input-otp.rodz.dev) documentation for more information.

View File

@@ -188,3 +188,14 @@ A full form example with multiple inputs, a select, and a button.
name="input-form" name="input-form"
previewClassName="h-[32rem]" previewClassName="h-[32rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="input-rtl"
direction="rtl"
previewClassName="*:max-w-xs"
/>

View File

@@ -161,6 +161,12 @@ Use the `render` prop to render the item as a link. The hover and focus states w
<ComponentPreview styleName="base-nova" name="item-dropdown" /> <ComponentPreview styleName="base-nova" name="item-dropdown" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="item-rtl" direction="rtl" />
## API Reference ## API Reference
### Item ### Item

View File

@@ -79,6 +79,12 @@ You can use the `Kbd` component inside a `InputGroupAddon` component to display
<ComponentPreview styleName="base-nova" name="kbd-input-group" /> <ComponentPreview styleName="base-nova" name="kbd-input-group" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="kbd-rtl" direction="rtl" />
## API Reference ## API Reference
### Kbd ### Kbd

View File

@@ -10,6 +10,12 @@ links:
<ComponentPreview styleName="base-nova" name="label-demo" /> <ComponentPreview styleName="base-nova" name="label-demo" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="label-rtl" direction="rtl" />
<Callout> <Callout>
For form fields, use the [Field](/docs/components/base/field) component which For form fields, use the [Field](/docs/components/base/field) component which
includes built-in label, description, and error handling. includes built-in label, description, and error handling.

View File

@@ -112,6 +112,12 @@ Use `MenubarSub`, `MenubarSubTrigger`, and `MenubarSubContent` for nested menus.
<ComponentPreview styleName="base-nova" name="menubar-icons" /> <ComponentPreview styleName="base-nova" name="menubar-icons" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="menubar-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Menubar](https://base-ui.com/react/components/menubar#api-reference) documentation. See the [Base UI Menubar](https://base-ui.com/react/components/menubar#api-reference) documentation.

View File

@@ -95,6 +95,16 @@ Use `aria-invalid` to show validation errors and the `data-invalid` attribute to
- Use `NativeSelect` for native browser behavior, better performance, or mobile-optimized dropdowns. - Use `NativeSelect` for native browser behavior, better performance, or mobile-optimized dropdowns.
- Use `Select` for custom styling, animations, or complex interactions. - Use `Select` for custom styling, animations, or complex interactions.
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="native-select-rtl"
direction="rtl"
/>
## API Reference ## API Reference
### NativeSelect ### NativeSelect

View File

@@ -37,7 +37,7 @@ npx shadcn@latest add navigation-menu
<Step>Install the following dependencies:</Step> <Step>Install the following dependencies:</Step>
```bash ```bash
npm install @base-ui-components/react npm install @base-ui/react
``` ```
<Step>Copy and paste the following code into your project.</Step> <Step>Copy and paste the following code into your project.</Step>
@@ -108,6 +108,17 @@ export function NavigationMenuDemo() {
} }
``` ```
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="navigation-menu-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
See the [Base UI Navigation Menu](https://base-ui.com/react/components/navigation-menu#api-reference) documentation for more information. See the [Base UI Navigation Menu](https://base-ui.com/react/components/navigation-menu#api-reference) documentation for more information.

View File

@@ -127,3 +127,9 @@ const PaginationLink = ({...props }: ) => (
**Note:** We are making updates to the cli to automatically do this for you. **Note:** We are making updates to the cli to automatically do this for you.
</Callout> </Callout>
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="pagination-rtl" direction="rtl" />

View File

@@ -99,6 +99,12 @@ A popover with form fields inside.
<ComponentPreview styleName="base-nova" name="popover-form" /> <ComponentPreview styleName="base-nova" name="popover-form" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="popover-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Popover](https://base-ui.com/react/components/popover#api-reference) documentation. See the [Base UI Popover](https://base-ui.com/react/components/popover#api-reference) documentation.

View File

@@ -76,6 +76,12 @@ A progress bar that can be controlled by a slider.
<ComponentPreview styleName="base-nova" name="progress-controlled" /> <ComponentPreview styleName="base-nova" name="progress-controlled" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="progress-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Progress](https://base-ui.com/react/components/progress#api-reference) documentation. See the [Base UI Progress](https://base-ui.com/react/components/progress#api-reference) documentation.

View File

@@ -104,6 +104,16 @@ Use `aria-invalid` on `RadioGroupItem` and `data-invalid` on `Field` to show val
<ComponentPreview styleName="base-nova" name="radio-group-invalid" /> <ComponentPreview styleName="base-nova" name="radio-group-invalid" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="radio-group-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Base UI Radio Group](https://base-ui.com/react/components/radio-group#api-reference) documentation. See the [Base UI Radio Group](https://base-ui.com/react/components/radio-group#api-reference) documentation.

View File

@@ -92,6 +92,12 @@ Use the `withHandle` prop on `ResizableHandle` to show a visible handle.
<ComponentPreview styleName="base-nova" name="resizable-handle" /> <ComponentPreview styleName="base-nova" name="resizable-handle" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="resizable-rtl" direction="rtl" />
## API Reference ## API Reference
See the [react-resizable-panels](https://github.com/bvaughn/react-resizable-panels/tree/main/packages/react-resizable-panels) documentation. See the [react-resizable-panels](https://github.com/bvaughn/react-resizable-panels/tree/main/packages/react-resizable-panels) documentation.

View File

@@ -78,4 +78,16 @@ Use `ScrollBar` with `orientation="horizontal"` for horizontal scrolling.
## API Reference ## API Reference
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="scroll-area-rtl"
direction="rtl"
/>
## API Reference
See the [Base UI Scroll Area](https://base-ui.com/react/components/scroll-area#api-reference) documentation. See the [Base UI Scroll Area](https://base-ui.com/react/components/scroll-area#api-reference) documentation.

View File

@@ -117,6 +117,12 @@ Add the `data-invalid` attribute to the `Field` component and the `aria-invalid`
<ComponentPreview styleName="base-nova" name="select-invalid" /> <ComponentPreview styleName="base-nova" name="select-invalid" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="select-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Select](https://base-ui.com/react/components/select#api-reference) documentation. See the [Base UI Select](https://base-ui.com/react/components/select#api-reference) documentation.

View File

@@ -82,6 +82,12 @@ Horizontal separators between list items.
<ComponentPreview styleName="base-nova" name="separator-list" /> <ComponentPreview styleName="base-nova" name="separator-list" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="separator-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Separator](https://base-ui.com/react/components/separator#api-reference) documentation. See the [Base UI Separator](https://base-ui.com/react/components/separator#api-reference) documentation.

View File

@@ -5,12 +5,12 @@ base: base
component: true component: true
--- ---
<figure className="flex flex-col gap-4"> <ComponentPreview
<ComponentPreview styleName="base-nova" name="sidebar-demo" type="block" /> styleName="base-nova"
<figcaption className="text-center text-sm text-gray-500"> name="sidebar-demo"
A sidebar that collapses to icons. type="block"
</figcaption> caption="A sidebar that collapses to icons."
</figure> />
Sidebars are one of the most complex components to build. They are central Sidebars are one of the most complex components to build. They are central
to any application and often contain a lot of moving parts. to any application and often contain a lot of moving parts.

View File

@@ -78,3 +78,9 @@ import { Skeleton } from "@/components/ui/skeleton"
### Table ### Table
<ComponentPreview styleName="base-nova" name="skeleton-table" /> <ComponentPreview styleName="base-nova" name="skeleton-table" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="skeleton-rtl" direction="rtl" />

View File

@@ -92,6 +92,12 @@ Use the `disabled` prop to disable the slider.
<ComponentPreview styleName="base-nova" name="slider-disabled" /> <ComponentPreview styleName="base-nova" name="slider-disabled" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="slider-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Slider](https://base-ui.com/react/components/slider#api-reference) documentation. See the [Base UI Slider](https://base-ui.com/react/components/slider#api-reference) documentation.

View File

@@ -105,3 +105,9 @@ Add a spinner to a badge to indicate a loading state. Remember to use the `data-
### Empty ### Empty
<ComponentPreview styleName="base-nova" name="spinner-empty" /> <ComponentPreview styleName="base-nova" name="spinner-empty" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="spinner-rtl" direction="rtl" />

View File

@@ -92,6 +92,12 @@ Use the `size` prop to change the size of the switch.
<ComponentPreview styleName="base-nova" name="switch-sizes" /> <ComponentPreview styleName="base-nova" name="switch-sizes" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="switch-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Switch](https://base-ui.com/react/components/switch#api-reference) documentation. See the [Base UI Switch](https://base-ui.com/react/components/switch#api-reference) documentation.

View File

@@ -104,3 +104,9 @@ You can use the `<Table />` component to build more complex data tables. Combine
See the [Data Table](/docs/components/data-table) documentation for more information. See the [Data Table](/docs/components/data-table) documentation for more information.
You can also see an example of a data table in the [Tasks](/examples/tasks) demo. You can also see an example of a data table in the [Tasks](/examples/tasks) demo.
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="table-rtl" direction="rtl" />

View File

@@ -95,6 +95,17 @@ Use `orientation="vertical"` for vertical tabs.
<ComponentPreview styleName="base-nova" name="tabs-icons" /> <ComponentPreview styleName="base-nova" name="tabs-icons" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="tabs-rtl"
direction="rtl"
previewClassName="w-[400px]"
/>
## API Reference ## API Reference
See the [Base UI Tabs](https://base-ui.com/react/components/tabs#api-reference) documentation. See the [Base UI Tabs](https://base-ui.com/react/components/tabs#api-reference) documentation.

View File

@@ -98,3 +98,9 @@ Pair with `Button` to create a textarea with a submit button.
name="textarea-button" name="textarea-button"
previewClassName="*:max-w-xs" previewClassName="*:max-w-xs"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="textarea-rtl" direction="rtl" />

View File

@@ -96,6 +96,16 @@ Use `orientation="vertical"` for vertical toggle groups.
<ComponentPreview styleName="base-nova" name="toggle-group-disabled" /> <ComponentPreview styleName="base-nova" name="toggle-group-disabled" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="base-nova"
name="toggle-group-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Base UI Toggle Group](https://base-ui.com/react/components/toggle-group#api-reference) documentation. See the [Base UI Toggle Group](https://base-ui.com/react/components/toggle-group#api-reference) documentation.

View File

@@ -33,7 +33,7 @@ npx shadcn@latest add toggle
<Step>Install the following dependencies:</Step> <Step>Install the following dependencies:</Step>
```bash ```bash
npm install @base-ui-components/react npm install @base-ui/react
``` ```
<Step>Copy and paste the following code into your project.</Step> <Step>Copy and paste the following code into your project.</Step>
@@ -84,6 +84,12 @@ Use the `size` prop to change the size of the toggle.
<ComponentPreview styleName="base-nova" name="toggle-disabled" /> <ComponentPreview styleName="base-nova" name="toggle-disabled" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="toggle-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Toggle](https://base-ui.com/react/components/toggle#api-reference) documentation. See the [Base UI Toggle](https://base-ui.com/react/components/toggle#api-reference) documentation.

View File

@@ -33,7 +33,7 @@ npx shadcn@latest add tooltip
<Step>Install the following dependencies:</Step> <Step>Install the following dependencies:</Step>
```bash ```bash
npm install @base-ui-components/react npm install @base-ui/react
``` ```
<Step>Copy and paste the following code into your project.</Step> <Step>Copy and paste the following code into your project.</Step>
@@ -89,6 +89,12 @@ Show a tooltip on a disabled button by wrapping it with a span.
<ComponentPreview styleName="base-nova" name="tooltip-disabled" /> <ComponentPreview styleName="base-nova" name="tooltip-disabled" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="base-nova" name="tooltip-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Base UI Tooltip](https://base-ui.com/react/components/tooltip#api-reference) documentation. See the [Base UI Tooltip](https://base-ui.com/react/components/tooltip#api-reference) documentation.

View File

@@ -137,6 +137,17 @@ Wrap the `Accordion` in a `Card` component.
previewClassName="*:data-[slot=accordion]:max-w-sm h-[32rem] md:h-[28rem]" previewClassName="*:data-[slot=accordion]:max-w-sm h-[32rem] md:h-[28rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="accordion-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
See the [Radix UI](https://www.radix-ui.com/primitives/docs/components/accordion#api-reference) documentation for more information. See the [Radix UI](https://www.radix-ui.com/primitives/docs/components/accordion#api-reference) documentation for more information.

View File

@@ -146,6 +146,17 @@ Use the `AlertDialogAction` component to add a destructive action button to the
previewClassName="h-56" previewClassName="h-56"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="alert-dialog-rtl"
direction="rtl"
previewClassName="h-56"
/>
## API Reference ## API Reference
### size ### size

View File

@@ -113,6 +113,17 @@ You can customize the alert colors by adding custom classes such as `bg-amber-50
previewClassName="h-auto sm:h-72 p-6" previewClassName="h-auto sm:h-72 p-6"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="alert-rtl"
direction="rtl"
previewClassName="h-auto sm:h-72 p-6"
/>
## API Reference ## API Reference
### Alert ### Alert

View File

@@ -82,6 +82,17 @@ A portrait aspect ratio component using the `ratio={9 / 16}` prop. This is usefu
previewClassName="h-96" previewClassName="h-96"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="aspect-ratio-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
### AspectRatio ### AspectRatio

View File

@@ -145,6 +145,17 @@ You can use the `Avatar` component as a trigger for a dropdown menu.
<ComponentPreview styleName="radix-nova" name="avatar-dropdown" /> <ComponentPreview styleName="radix-nova" name="avatar-dropdown" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="avatar-rtl"
direction="rtl"
previewClassName="h-72"
/>
## API Reference ## API Reference
### Avatar ### Avatar

View File

@@ -81,6 +81,12 @@ You can customize the colors of a badge by adding custom classes such as `bg-gre
<ComponentPreview styleName="radix-nova" name="badge-colors" /> <ComponentPreview styleName="radix-nova" name="badge-colors" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="badge-rtl" direction="rtl" />
## API Reference ## API Reference
### Badge ### Badge

View File

@@ -110,6 +110,17 @@ To use a custom link component from your routing library, you can use the `asChi
<ComponentPreview styleName="radix-nova" name="breadcrumb-link" /> <ComponentPreview styleName="radix-nova" name="breadcrumb-link" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="breadcrumb-rtl"
direction="rtl"
previewClassName="p-2"
/>
## API Reference ## API Reference
### Breadcrumb ### Breadcrumb

View File

@@ -148,6 +148,16 @@ Use with a `Popover` component.
<ComponentPreview styleName="radix-nova" name="button-group-popover" /> <ComponentPreview styleName="radix-nova" name="button-group-popover" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="button-group-rtl"
direction="rtl"
/>
## API Reference ## API Reference
### ButtonGroup ### ButtonGroup

View File

@@ -141,6 +141,12 @@ You can use the `asChild` prop on `<Button />` to make another component look li
<ComponentPreview styleName="radix-nova" name="button-aschild" /> <ComponentPreview styleName="radix-nova" name="button-aschild" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="button-rtl" direction="rtl" />
## API Reference ## API Reference
### Button ### Button

View File

@@ -501,6 +501,17 @@ npx shadcn@latest add calendar-02
This will install the latest version of the calendar blocks. This will install the latest version of the calendar blocks.
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="calendar-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
See the [React DayPicker](https://react-day-picker.js.org) documentation for more information on the `Calendar` component API. See the [React DayPicker](https://react-day-picker.js.org) documentation for more information on the `Calendar` component API.

View File

@@ -99,6 +99,17 @@ Add an image before the card header to create a card with an image.
previewClassName="h-[32rem]" previewClassName="h-[32rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="card-rtl"
direction="rtl"
previewClassName="h-[30rem]"
/>
## API Reference ## API Reference
### Card ### Card

View File

@@ -285,6 +285,17 @@ export function Example() {
previewClassName="sm:h-[32rem]" previewClassName="sm:h-[32rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="carousel-rtl"
direction="rtl"
previewClassName="h-80 sm:h-[32rem]"
/>
## API Reference ## API Reference
See the [Embla Carousel docs](https://www.embla-carousel.com/api/plugins/) for more information on props and plugins. See the [Embla Carousel docs](https://www.embla-carousel.com/api/plugins/) for more information on props and plugins.

View File

@@ -122,6 +122,17 @@ Use multiple fields to create a checkbox list.
previewClassName="p-4 md:p-8" previewClassName="p-4 md:p-8"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="checkbox-rtl"
direction="rtl"
previewClassName="h-80"
/>
## API Reference ## API Reference
See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/checkbox#api-reference) documentation for more information. See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/checkbox#api-reference) documentation for more information.

View File

@@ -122,6 +122,16 @@ Use nested collapsibles to build a file tree.
previewClassName="h-[36rem]" previewClassName="h-[36rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="collapsible-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/collapsible#api-reference) documentation for more information. See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/collapsible#api-reference) documentation for more information.

View File

@@ -254,7 +254,13 @@ You can trigger the combobox from a button or any other component by using the `
You can add an addon to the combobox by using the `InputGroupAddon` component inside the `ComboboxInput`. You can add an addon to the combobox by using the `InputGroupAddon` component inside the `ComboboxInput`.
<ComponentPreview styleName="base-nova" name="combobox-input-group" /> <ComponentPreview styleName="radix-nova" name="combobox-input-group" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="combobox-rtl" direction="rtl" />
## API Reference ## API Reference

View File

@@ -120,6 +120,18 @@ Scrollable command menu with multiple items.
<ComponentPreview styleName="radix-nova" name="command-scrollable" /> <ComponentPreview styleName="radix-nova" name="command-scrollable" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="command-rtl"
direction="rtl"
align="start"
previewClassName="h-[24.5rem]"
/>
## API Reference ## API Reference
See the [cmdk](https://github.com/dip/cmdk) documentation for more information. See the [cmdk](https://github.com/dip/cmdk) documentation for more information.

View File

@@ -135,6 +135,16 @@ Control submenu placement with side and align props.
<ComponentPreview styleName="radix-nova" name="context-menu-sides" /> <ComponentPreview styleName="radix-nova" name="context-menu-sides" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="context-menu-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/context-menu#api-reference) documentation for more information. See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/context-menu#api-reference) documentation for more information.

View File

@@ -93,3 +93,13 @@ A date picker component with a time input field for selecting a time.
This component uses the `chrono-node` library to parse natural language dates. This component uses the `chrono-node` library to parse natural language dates.
<ComponentPreview styleName="radix-nova" name="date-picker-natural-language" /> <ComponentPreview styleName="radix-nova" name="date-picker-natural-language" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="date-picker-rtl"
direction="rtl"
/>

View File

@@ -111,6 +111,12 @@ Long content can scroll while the header stays in view.
<ComponentPreview styleName="radix-nova" name="dialog-scrollable-content" /> <ComponentPreview styleName="radix-nova" name="dialog-scrollable-content" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="dialog-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/dialog#api-reference) documentation for more information. See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/dialog#api-reference) documentation for more information.

View File

@@ -108,6 +108,12 @@ You can combine the `Dialog` and `Drawer` components to create a responsive dial
<ComponentPreview styleName="radix-nova" name="drawer-dialog" /> <ComponentPreview styleName="radix-nova" name="drawer-dialog" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="drawer-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Vaul documentation](https://vaul.emilkowal.ski/getting-started) for the full API reference. See the [Vaul documentation](https://vaul.emilkowal.ski/getting-started) for the full API reference.

View File

@@ -163,6 +163,16 @@ A richer example combining groups, icons, and submenus.
<ComponentPreview styleName="radix-nova" name="dropdown-menu-complex" /> <ComponentPreview styleName="radix-nova" name="dropdown-menu-complex" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="dropdown-menu-rtl"
direction="rtl"
/>
## API Reference ## API Reference
See the [Radix UI documentation](https://www.radix-ui.com/docs/primitives/components/dropdown-menu) for the full API reference. See the [Radix UI documentation](https://www.radix-ui.com/docs/primitives/components/dropdown-menu) for the full API reference.

View File

@@ -127,6 +127,12 @@ You can add an `InputGroup` component to the `EmptyContent` component.
previewClassName="h-96 p-0" previewClassName="h-96 p-0"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="empty-rtl" direction="rtl" />
## API Reference ## API Reference
### Empty ### Empty

View File

@@ -162,6 +162,17 @@ Stack `Field` components with `FieldGroup`. Add `FieldSeparator` to divide them.
previewClassName="h-96" previewClassName="h-96"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="field-rtl"
direction="rtl"
previewClassName="h-[800px] p-6 md:h-[850px]"
/>
## Responsive Layout ## Responsive Layout
- **Vertical fields:** Default orientation stacks label, control, and helper text—ideal for mobile-first layouts. - **Vertical fields:** Default orientation stacks label, control, and helper text—ideal for mobile-first layouts.

View File

@@ -118,6 +118,17 @@ Use the `side` and `align` props on `HoverCardContent` to control placement.
previewClassName="h-[22rem]" previewClassName="h-[22rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="hover-card-rtl"
direction="rtl"
previewClassName="h-80"
/>
## API Reference ## API Reference
See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/hover-card#api-reference) documentation for more information. See the [Radix UI](https://www.radix-ui.com/docs/primitives/components/hover-card#api-reference) documentation for more information.

View File

@@ -191,6 +191,17 @@ Here's an example of a custom resizable textarea from a third-party library.
previewClassName="h-56" previewClassName="h-56"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="input-group-rtl"
direction="rtl"
previewClassName="h-[30rem]"
/>
## API Reference ## API Reference
### InputGroup ### InputGroup

View File

@@ -142,6 +142,12 @@ Use `REGEXP_ONLY_DIGITS_AND_CHARS` to accept both letters and numbers.
previewClassName="h-[30rem]" previewClassName="h-[30rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="input-otp-rtl" direction="rtl" />
## API Reference ## API Reference
See the [input-otp](https://input-otp.rodz.dev) documentation for more information. See the [input-otp](https://input-otp.rodz.dev) documentation for more information.

View File

@@ -188,3 +188,14 @@ A full form example with multiple inputs, a select, and a button.
name="input-form" name="input-form"
previewClassName="h-[32rem]" previewClassName="h-[32rem]"
/> />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="input-rtl"
direction="rtl"
previewClassName="*:max-w-xs"
/>

View File

@@ -163,6 +163,12 @@ Use the `asChild` prop to render the item as a link. The hover and focus states
<ComponentPreview styleName="radix-nova" name="item-dropdown" /> <ComponentPreview styleName="radix-nova" name="item-dropdown" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="item-rtl" direction="rtl" />
## API Reference ## API Reference
### Item ### Item

View File

@@ -79,6 +79,12 @@ You can use the `Kbd` component inside a `InputGroupAddon` component to display
<ComponentPreview styleName="radix-nova" name="kbd-input-group" /> <ComponentPreview styleName="radix-nova" name="kbd-input-group" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="kbd-rtl" direction="rtl" />
## API Reference ## API Reference
### Kbd ### Kbd

View File

@@ -10,6 +10,12 @@ links:
<ComponentPreview styleName="radix-nova" name="label-demo" /> <ComponentPreview styleName="radix-nova" name="label-demo" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="label-rtl" direction="rtl" />
<Callout> <Callout>
For form fields, use the [Field](/docs/components/radix/field) component which For form fields, use the [Field](/docs/components/radix/field) component which
includes built-in label, description, and error handling. includes built-in label, description, and error handling.

View File

@@ -112,6 +112,12 @@ Use `MenubarSub`, `MenubarSubTrigger`, and `MenubarSubContent` for nested menus.
<ComponentPreview styleName="radix-nova" name="menubar-icons" /> <ComponentPreview styleName="radix-nova" name="menubar-icons" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="menubar-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Radix UI Menubar](https://www.radix-ui.com/docs/primitives/components/menubar#api-reference) documentation. See the [Radix UI Menubar](https://www.radix-ui.com/docs/primitives/components/menubar#api-reference) documentation.

View File

@@ -95,6 +95,16 @@ Use `aria-invalid` to show validation errors and the `data-invalid` attribute to
- Use `NativeSelect` for native browser behavior, better performance, or mobile-optimized dropdowns. - Use `NativeSelect` for native browser behavior, better performance, or mobile-optimized dropdowns.
- Use `Select` for custom styling, animations, or complex interactions. - Use `Select` for custom styling, animations, or complex interactions.
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="native-select-rtl"
direction="rtl"
/>
## API Reference ## API Reference
### NativeSelect ### NativeSelect

View File

@@ -105,6 +105,17 @@ export function NavigationMenuDemo() {
} }
``` ```
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="navigation-menu-rtl"
direction="rtl"
previewClassName="h-96"
/>
## API Reference ## API Reference
See the [Radix UI Navigation Menu](https://www.radix-ui.com/docs/primitives/components/navigation-menu#api-reference) documentation for more information. See the [Radix UI Navigation Menu](https://www.radix-ui.com/docs/primitives/components/navigation-menu#api-reference) documentation for more information.

View File

@@ -127,3 +127,13 @@ const PaginationLink = ({...props }: ) => (
**Note:** We are making updates to the cli to automatically do this for you. **Note:** We are making updates to the cli to automatically do this for you.
</Callout> </Callout>
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview
styleName="radix-nova"
name="pagination-rtl"
direction="rtl"
/>

View File

@@ -99,6 +99,12 @@ A popover with form fields inside.
<ComponentPreview styleName="radix-nova" name="popover-form" /> <ComponentPreview styleName="radix-nova" name="popover-form" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="popover-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Radix UI Popover](https://www.radix-ui.com/docs/primitives/components/popover#api-reference) documentation. See the [Radix UI Popover](https://www.radix-ui.com/docs/primitives/components/popover#api-reference) documentation.

View File

@@ -76,6 +76,12 @@ A progress bar that can be controlled by a slider.
<ComponentPreview styleName="radix-nova" name="progress-controlled" /> <ComponentPreview styleName="radix-nova" name="progress-controlled" />
## RTL
To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl).
<ComponentPreview styleName="radix-nova" name="progress-rtl" direction="rtl" />
## API Reference ## API Reference
See the [Radix UI Progress](https://www.radix-ui.com/docs/primitives/components/progress#api-reference) documentation. See the [Radix UI Progress](https://www.radix-ui.com/docs/primitives/components/progress#api-reference) documentation.

Some files were not shown because too many files have changed in this diff Show More