How to use the @rmwc/base.useClassNames function in @rmwc/base

To help you get started, we’ve selected a few @rmwc/base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesmfriedman / rmwc / src / badge / index.tsx View on Github external
export function BadgeAnchor(props: BadgeAnchorProps & RMWC.ComponentProps) {
  const { children, ...rest } = props;
  const className = useClassNames(props, ['rmwc-badge-anchor']);
  return (
    <div>
      {children}
    </div>
  );
}
github jamesmfriedman / rmwc / src / badge / index.tsx View on Github external
export function Badge(props: BadgeProps &amp; Omit) {
  const { align = 'end', label, style, exited, inset, ...rest } = props;
  const className = useClassNames(props, [
    'rmwc-badge',
    `rmwc-badge--align-${align}`,
    {
      'rmwc-badge--no-content': !(label ?? false),
      'rmwc-badge--exited': exited
    }
  ]);

  const finalStyle =
    inset !== undefined
      ? {
          ...style,
          '--rmwc-badge-inset': inset
        }
      : style;