'direction' component found in docs but missing from registry #9622
Replies: 2 comments
-
|
This looks like the direction component hasn't been published to the registry yet — the RTL docs reference it but the JSON doesn't exist at ui.shadcn.com/r/styles/new-york/direction.json. In the meantime, you can set up RTL support manually using Radix's Direction provider directly: import { DirectionProvider } from "@radix-ui/react-direction"; export default function App({ children }: { children: React.ReactNode }) { This is effectively what the shadcn direction component wraps — it just hasn't been added to the registry yet. You might want to open an issue to track it if one doesn't exist already. |
Beta Was this translation helpful? Give feedback.
-
|
yeah this is a known doc/registry mismatch lol the quick workaround — do it manually: npm install @radix-ui/react-directionthen create "use client"
import { DirectionProvider as RadixDirectionProvider } from "@radix-ui/react-direction"
type Direction = "ltr" | "rtl"
function DirectionProvider({ children, direction }: { children: React.ReactNode; direction: Direction }) {
return (
<RadixDirectionProvider dir={direction}>
{children}
</RadixDirectionProvider>
)
}
export { DirectionProvider }then in ur <DirectionProvider direction="rtl">
{children}
</DirectionProvider>also add |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation for RTL support (https://ui.shadcn.com/docs/rtl) and the Direction component (https://ui.shadcn.com/docs/components/radix/direction) instructs users to install the direction provider using the CLI command: npx shadcn@latest add direction
However, running this command fails because the item does not exist in the registry.
Beta Was this translation helpful? Give feedback.
All reactions