Skip to content

useTextDirection ​

browser
test coverage
Last changed: 24 days ago

Hook that can get and set the direction of the element

typescript
import { useTextDirection } from '@siberiacancode/reactuse';

Usage ​

typescript
const { value, set, remove } = useTextDirection(ref);
// or
const { ref, value, set, remove } = useTextDirection();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
targetHookTarget-The target element to observe
initialValue?UseTextDirectionValue'ltr'The initial direction of the element

Parameters

NameTypeDefaultNote
initialValue?UseTextDirectionValue'ltr'The initial direction of the element

Source ​

Source • Demo

Contributors ​

Avatardebabin
AvatarVLADISLAW9

Released under the MIT License.