Task modal

A task opened in a modal: its properties and progress, subtasks to tick off, and tabs over the activity log.

Open full screen

A panel opens over any screen and keeps its own look in every direction: it has no direction of its own.

npx wideset add block-modal-task

Import the default export from @/blocks/wideset/modal-task. The files below are relative to your project's source directory.

Installed with this block
  • avatar
  • block-styles
  • button
  • checkbox
  • icon-button
  • modal
  • progress-bar
  • status-badge
  • switch
  • tabs
  • utils
blocks/wideset/modal-task/index.tsx
'use client';

import '@/styles/wideset-blocks.css';

import { Button } from '@/components/ui/wideset/button/Button';
import { useState } from 'react';

import { task } from './data';
import { TaskModal } from './task-modal';

/** Task modal: a task opened over the page, here over an empty page that reopens it. */
export default function ModalTaskBlock() {
  const [open, setOpen] = useState(true);

  return (
    <div className="ws-block-utility bg-ws-static-foreground flex h-dvh items-center justify-center">
      <Button variant="secondary" preset="border" onClick={() => setOpen(true)}>
        Open task
      </Button>
      <TaskModal task={task} open={open} onOpenChange={setOpen} />
    </div>
  );
}