185 Pro components and page blocks

Get Pro

Updated

Inline Rewrite

Pro

Preview

Customize

Accent
Duration420ms
Stagger35ms

Installation

Pro

Inline Rewrite is a Pro component

Sign in to see the source, or install it with a license key. The live preview and props above are free to explore.

Install with a key

  1. Add the Pro registry to components.json:
    components.json
    {
      "registries": {
        "@uibrik-pro": {
          "url": "https://uibrik.com/r/pro/{name}.json",
          "headers": { "Authorization": "Bearer ${UIBRIK_LICENSE}" }
        }
      }
    }
  2. Put your key in .env.local and add that file to .gitignore:
    .env.local
    UIBRIK_LICENSE=your-license-key
  3. Install it:
    Terminal
    npx shadcn@latest add @uibrik-pro/inline-rewrite

Usage

import { InlineRewrite } from "@/components/uibrik/inline-rewrite/inline-rewrite";​const value = "hey team, just wanted to quickly check in about the launch. i think we are kind of behind on the docs and honestly the onboarding still feels a bit confusing. can we maybe find some time this week to go over it together?";​const actions = [  { id: "improve", label: "Improve" },  { id: "shorter", label: "Shorter" },  // …1 more];​<InlineRewrite  onRewrite={(text, action) => {}}  accent="#8b5cf6"  duration={420}  stagger={35}  highlightChanges  value={value}  defaultValue=""  actions={actions}  aria-label="Email draft"  onChange={(value) => {}}  // textClassName="…"/>

Where to use Inline Rewrite

  • Writing and email tools

    Selecting a sentence and picking Improve, Shorter or Formal morphs the wording in place, so the change is easy to follow.

    Pairs with Email Composer and Prompt Input

  • AI editors and docs

    New words keep a fading wash after the morph, so readers see exactly what the model touched.

    Pairs with Streaming Chat and Cited Answer

  • Product copy review

    Undo and Cmd+Z morph the original wording back, which makes trying several rewrites feel safe.

Props

InlineRewrite
accent
Type string
"#8b5cf6"
Loading wave, incoming words and their wash.
duration
Type number
420
Length of the morph.
stagger
Type number
35
Delay between new words wiping in.
highlightChanges
Type boolean
true
Leave a fading wash on the new words.
onRewriterequired
Type (text: string, action: string) => Promise<string> | string
–
Returns the rewritten selection, e.g. from an AI call.
value
Type string
–
The text. Pass with onChange to control it.
defaultValue
Type string
–
Starting text when uncontrolled.
onChange
Type (value: string) => void
–
Called with the full text after each rewrite or undo.
actions
Type { id: string; label: string }[]
Improve, Shorter, Formal
Toolbar buttons. The first runs on Cmd+Enter.
ref
Type Ref<{ select(start, end): void; rewrite(start, end, action?): void; undo(): void }>
–
Drive it from code, e.g. a first-visit hint.
aria-label
Type string
"Text"
Accessible name for the text block.
className
Type string
–
Classes for the wrapper.
textClassName
Type string
–
Classes for the text, such as font size and line height.