How to use the reakit.useDialogState function in reakit

To help you get started, we’ve selected a few reakit 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 reakit / reakit / stories / index.stories.tsx View on Github external
function Example() {
    const dialog = useDialogState();
    return (
      <>
        Open dialog
        <dialog aria-label="Welcome">
          {dialogProps =&gt;
            dialog.visible &amp;&amp; <div>Welcome to Reakit!</div>
          }
        </dialog>
      
    );
  }
  return ;
github reakit / reakit / examples / kanban / components / Board.tsx View on Github external
function Board() {
  const rover = useRoverState({ orientation: "horizontal" });
  const dialog = useDialogState();
  const { columns, addColumn, removeColumn, editColumn } = useBoardContext();

  return (
    <div style="{{">
      {columns.map(column =&gt; (
         editColumn(column.id, content)}
          onRemove={() =&gt; removeColumn(column.id)}
        /&gt;
      ))}
      
        Create column</div>
github reakit / reakit / stories / index.stories.tsx View on Github external
(props, ref: React.RefObject) =&gt; {
        const dialog = useDialogState();
        const [value, setValue] = React.useState("");
        return (
          &lt;&gt;
            
              Open dialog...
            
            <dialog aria-label="Dialog with input">
              <input value="{value}" type="text"> setValue(event.target.value)}
              /&gt;
            </dialog>
          
        );
      }
github reakit / reakit / packages / website / src / components / Header.tsx View on Github external
export default function Header({ transparent }: HeaderProps) {
  const ref = React.useRef(null);
  const isLarge = useViewportWidthGreaterThan(768);
  const background = usePalette("background");
  const foreground = usePalette("foreground");
  const primary = usePalette("primary");
  const boxShadowColor = useFade(foreground, 0.85);
  const dialog = useDialogState({ unstable_animated: true });
  const location = useLocation();

  React.useEffect(dialog.hide, [location.pathname]);

  return (
    &lt;&gt;
github reakit / reakit / examples / kanban / components / Card.tsx View on Github external
function Card({ content, onSubmit, onRemove, ...props }: CardProps) {
  const dialog = useDialogState();
  return (
    &lt;&gt;
      
        {htmlProps =&gt; (
          
            {content}
          
        )}