UNPKG

@amsterdam/design-system-react

Version:

All React components from the Amsterdam Design System. Use it to compose pages in your website or application.

9 lines (8 loc) 623 B
import { jsx as _jsx } from "react/jsx-runtime"; import { clsx } from 'clsx'; import { forwardRef } from 'react'; /** * @see {@link https://designsystem.amsterdam/?path=/docs/components-forms-character-count--docs Character Count docs at Amsterdam Design System} */ export const CharacterCount = forwardRef(({ className, length, maxLength, ...restProps }, ref) => (_jsx("div", { ...restProps, className: clsx('ams-character-count', length > maxLength && 'ams-character-count--error', className), ref: ref, role: "status", children: `${length} van ${maxLength} tekens` }))); CharacterCount.displayName = 'CharacterCount';