[v4] Button: `buttonStyle="link"` is in the type but has no styles
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- css, react, typescript
Research direction
Start with packages/ui/src/elements/Button/types.ts and packages/ui/src/elements/Button/index.css; compare the link style with the existing button styles and check how the other listed components use the same union. Decide whether the intended fix is adding link styling or removing the unused type value, then verify the enabled, disabled, selected, and hover states match the chosen behavior.
Written by the indexing model from the issue text.
Description
Describe the Bug.
ButtonProps['buttonStyle'] accepts 'link', but Button/index.css has no .btn--style-link rules. A link button gets only the base .btn styles (transparent background, color: inherit) and renders as bare text in the surrounding text color:
- no hover state, not even the background fill
ghostgets on hover; disabledlooks the same as enabled; the only difference iscursor: not-allowed;selectedhas no visible effect;- nothing about it looks like a link: no link color and no underline.
'link' was added to the buttonStyle unions of Button, DrawerToggler, DrawerHeaderAction and DocumentDrawerToggler in #18395 (fix(ui): align hierarchy checkbox styles). That PR added no CSS for it, and nothing in the repo passes buttonStyle="link" (main at 526bd4f). So it looks like a leftover. Before #18395 the v4 union was 'dashed' | 'destructive' | 'ghost' | 'pill' | 'primary' | 'secondary', and 3.x never had 'link'.
Expected: either link gets a link-like style (link color, underline on hover, dimmed when disabled), or 'link' is removed from the types.
Reproduction Steps
- Type:
packages/ui/src/elements/Button/types.ts - Styles (no
.btn--style-link):packages/ui/src/elements/Button/index.css - Also in the unions:
packages/ui/src/elements/Drawer/types.ts(DrawerHeaderAction['style'],TogglerProps['buttonStyle']) andpackages/ui/src/elements/DocumentDrawer/types.ts(DocumentTogglerProps['buttonStyle'])
'use client'
import { Button } from '@payloadcms/ui'
export const LinkButtons = () => (
<>
<Button buttonStyle="link">Enabled</Button>
<Button buttonStyle="link" disabled>Disabled</Button>
<Button buttonStyle="link" selected>Selected</Button>
</>
)
- Mount the component above anywhere in the admin, e.g.
admin.components.beforeDashboard. - All three buttons look the same, and hovering any of them changes nothing.
grep style-link node_modules/@payloadcms/ui/dist/elements/Button/index.cssfinds nothing.
Environment Info
payload: 4.0.0-beta.7
@payloadcms/ui: 4.0.0-beta.7
Node: 24
- Dominant language
- TypeScript
- Stars
- 45.6k
- Forks
- 4.4k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 237
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from payloadcms/payload
-
plugin-multi-tenant: `isGlobal` collections redirect tenant-scoped users to `/admin` since 3.93.0 (GlobalViewRedirect prop-name mismatch)Possibly taken A pull request linked to this issue is open or already merged. OpenBug plugin: multi-tenant
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19420 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19413 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19412 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19403 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19395 ·
Maintainers usually reply within 1 day
All issues in payloadcms/payload
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
documentation easy good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Billion-context documentation addendum: nudge is independent of window occupancy. | billion-context 文档补充:nudge 与窗口占用无关Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
ranxianglei/billion-context#5893 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/monaco-editor#5575 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100