К содержимому
uiify

Progress

Native progress element for determinate or indeterminate work.

Браузеры
Chrome 123+Firefox 121+Safari 17.5+
Уровень
0
Сжатый размер
93 B
Лимит принудительной компоновки
0 ms
Лимит axe
0
Совместим с SSR
Да
Публичный контракт
Тестовый стенд

Песочница

Progress

import { Progress } from "@gunkin/uiify";

export default function Example() {
  return (
    <>
      <label htmlFor="migration-progress">Migration progress</label>
      <Progress className="" id="migration-progress" max={5} value={3} />
    </>
  );
}
@layer components {
  [data-uiify-progress] {
    inline-size: 100%;
    block-size: 0.5rem;
    accent-color: var(--primary);
  }
}
import { Progress } from "@gunkin/uiify";

export default function Example() {
  return (
    <>
      <label htmlFor="migration-progress">Migration progress</label>
      <Progress
        className="block [inline-size:100%] [block-size:0.5rem] [accent-color:var(--primary)]"
        id="migration-progress"
        max={5}
        value={3}
      />
    </>
  );
}
/* app.css */

@layer reset, ui, app, tokens, base, demo, components, utilities, theme;

@import "@gunkin/uiify/styles/reset";

@import "@gunkin/uiify/components/behavior.css";

@import "@gunkin/uiify/styles/tokens";

@import "@gunkin/uiify/styles/tailwind";

@import "tailwindcss/utilities.css";

@theme { --spacing: 0.25rem; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; }

@source inline('block [inline-size:100%] [block-size:0.5rem] [accent-color:var(--primary)]');

@layer base { :root { --uiify-control-text: var(--text-sm); } @media (pointer: coarse) { :root { --uiify-control-text: var(--text-base); } } }

/* Authored animation and registered properties used by the Tailwind skin.
 * Visual rules belong in utility recipes; only at-rule definitions live here. */
@layer components {
  @keyframes uiify-presence-in {
    from {
      opacity: 0;
      scale: var(--presence-scale);
    }
  }
}

@layer components {
  @keyframes uiify-presence-out {
    to {
      opacity: 0;
      scale: var(--presence-scale);
    }
  }
}

@property --uiify-spinner-tail {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --uiify-spinner-length {
  syntax: "<angle>";
  inherits: false;
  initial-value: 36deg;
}

@layer components {
  @keyframes uiify-spinner-rotate {
    to {
      transform: rotate(360deg);
    }
  }
}

@layer components {
  @keyframes uiify-spinner-orbit {
    0% {
      --uiify-spinner-tail: 0deg;
      --uiify-spinner-length: 36deg;
    }

    50% {
      --uiify-spinner-tail: 90deg;
      --uiify-spinner-length: 324deg;
    }

    100% {
      --uiify-spinner-tail: 360deg;
      --uiify-spinner-length: 36deg;
    }
  }
}

@layer components {
  @keyframes uiify-skeleton-pulse {
    50% {
      opacity: 0.45;
    }
  }
}

@layer components {
  @keyframes uiify-skeleton-shimmer {
    to {
      background-position: -200% 0;
    }
  }
}

@layer components {
  @keyframes uiify-skeleton-reveal {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

@property --candle-body-height {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

@property --candle-body-top {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --candle-slot {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 100%;
}

@property --candle-wick-height {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

@property --candle-wick-top {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --candle-x {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

@property --candle-scale {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

@property --line-y {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --line-prev-y {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@property --line-count {
  syntax: "<integer>";
  inherits: false;
  initial-value: 1;
}

@property --line-scale {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

@layer components {
  @keyframes uiify-otp-input-caret-blink {
    50% {
      opacity: 0;
    }
  }
}

Примеры

Indeterminate work

Omit value when the amount of completed work is unknown.

import { Progress } from "@gunkin/uiify";

export default function Example() {
  return (
    <>
      <label htmlFor="file-progress">Preparing files</label>
      <Progress id="file-progress" />
    </>
  );
}

API

Progress

СвойствоТипПо умолчаниюОписание
valuenumber—Current progress value; omit it for indeterminate progress.
maxnumber1Maximum progress value accepted by the native element.
Accessible name*native <label> / aria-label / aria-labelledby—Provide an accessible name with aria-label, aria-labelledby, or a native label.
classNamestring—Class applied to the native progress element.
styleCSSProperties—Native progress element styles.
refRef<HTMLProgressElement>—Ref forwarded to the native progress element.

Клавиатура

КлавишаДействие

Доступность

Native progress element. Associate a label or accessible name; omitting value exposes indeterminate progress. Browser rendering varies, and UIify does not simulate updates or announce them.

Привязка стилей

data-uiify-progress