Skip to content

Direction Provider

Overview

DirectionProvider manages the dir HTML attribute which controls CSS logical properties and layout direction. All Paramanu CSS uses logical properties so components automatically adapt to the configured direction.

Usage

import { setDirection, getDirection } from "@paramanu/utilities-js"
setDirection("rtl")
console.log(getDirection()) // "rtl"

Guidelines

  • Use for applications that support Arabic, Hebrew, or other RTL languages
  • All Paramanu components use CSS logical properties for automatic adaptation
  • The useDirection hook provides read/write access to the current direction
  • Sets the dir attribute on document.documentElement by default

API

PropTypeDefaultDescription
defaultDir"ltr" | "rtl""ltr"Initial text direction