Skip to content

Icon parity with javaabu/forms v2: eye, pencil, trash-2, check, … #21

Closed

Description

@n4ff4h

From javaabu/permissions (next-gen), whose role pages ship in both Blade and Inertia React.

javaabu/forms v2 bundles 30 Lucide icons for start-icon / end-icon (arrow-down, arrow-up, arrow-up-down, calendar, check, chevron-*, circle-alert, circle-check, circle-x, clock, download, ellipsis, external-link, eye, file, file-text, image, info, loader-circle, map-pin, pencil, plus, search, trash-2, triangle-alert, upload, x; see its docs/basic-usage/icons.md).

@javaabu/forms' IconName only has download, close, plus, error, chevron-up/down/left/right and chevrons-up-down, so this doesn't typecheck:

<LinkButton url={links.edit} color="secondary" size="sm" startIcon="pencil">Edit</LinkButton>
<Submit color="danger" size="sm" startIcon="trash-2">Delete</Submit>

The Blade role pages use eye, pencil, trash-2 and check on their buttons; the React pages leave the icons out for now.

Suggested: accept the same names as Blade (IconName as the union of the bundled Lucide names, mapped in the Onu adapter), and list the difference in docs/parity.md until then.

Activity

  1. added
    next-genNext-gen Javaabu packages
    cross-packageRequested by or affecting another next-gen package
    on Nov 4, 2026
  2. n4ff4h commented on Nov 5, 2026

    @n4ff4h
    CollaboratorAuthor

    Done in 204e616 on next-gen (PR #19), CI green: https://github.com/Javaabu/react-forms/actions/runs/42055926515

    IconName now accepts Blade's 30 bundled Lucide names (eye, pencil, trash-2, check, …). Any other string is treated as icon-font classes, which render as <i class> as in Blade. close and error stay as aliases. So startIcon="pencil" and startIcon="trash-2" now typecheck on Button, Submit and LinkButton.

    • HTML and shadcn adapters draw inline Lucide SVGs, generated from lucide-react 1.68 (the version Blade uses) by scripts/icons.mjs.
    • The Onu adapter maps to Onu's semantic names (pencil → edit, trash-2 → trash, x → close, …), so OnuProvider icons overrides apply. circle-alert and circle-x, which Onu doesn't name, use the Lucide SVG.
    • New Icon component (Blade's <x-forms::icon>), plus BUNDLED_ICONS, ICON_ALIASES and resolveIconName() for adapters.
    • A conformance case in @javaabu/forms/testing checks that every adapter draws them.
    • Docs: docs/basic-usage/icons.md; docs/parity.md now lists Icon ↔ icon as ✅. Blade's icons config stays Blade-only.

    The role pages can now use the same icons as the Blade ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-packageRequested by or affecting another next-gen packagenext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions