Text Link Row
FreeA line of text followed by a link, such as “Don't have an account? Sign up”, or a back link with an arrow.
npx wunderui-cli add text-link-rowPlayground
Don't have an account?Sign up
Wrong address?Change email
Don't have access anymore?Try another method
Need help?Contact support
Installation
npx wunderui-cli add text-link-rowWrites the source into your project with its dependencies and, on first use, the styles - see Installation.
Then import what you need:
import { TextLinkRow } from "@/components/blocks/auth"
import type { TextLinkRowProps } from "@/components/blocks/auth"Then use it:
import { TextLinkRow } from "@wunderui/react"
export function SignInFooter() {
return <TextLinkRow text="Don't have an account?" link="Sign up" href="/sign-up" />
}Expected result: One line of grey text followed by a semibold indigo link. The link is underlined on hover and goes to /sign-up.
When to use
Use Text Link Row for
- The line under a sign-in or sign-up form that names the other way in, such as Don't have an account? Sign up
- A second line of help next to a field or a button, such as Resend, Change email or Contact support
- The way back on a verification, reset or code screen
Link
The link is a real anchor: give it an href to go somewhere, or a click handler that prevents the default to run an action. Leave the link out and only the text is shown.
Alignment
The row fills its container and starts at the left, and a class centres it or pushes it to the end. The back variant is as wide as its content and is moved by its container.
Content
The text and the link are two flex items, so a long text wraps in its own column and squeezes the link. Keep the text to one short sentence, or let the whole link drop under the text.
Don't have an account?Sign up
By continuing you confirm that you have read the terms of service and the privacy policy of WunderUI.Read the terms
Don't have an account?Sign up
Don't have an account?Sign up
Keyboard interactions
The row itself handles no keys. The link and the back link are native anchors and work the way the browser makes them work.
- TaborShift+Tab
- Moves focus to the link, or to the back link, and away from it again. The text is skipped.
- Enter
- Follows the focused link to its . With the handler runs first; call there to stay on the page.
- Space
- Does nothing on a link. The browser may scroll the page.
A link follows on Enter only. Space doesn't follow a link, as with any link, and the browser may scroll the page instead.
Behavior and motion
What the row does with its parts and its width, and what it leaves to you.
- Variants
- Inline is the 14 px line, small is 12 px tertiary, stacked puts text over the link, icon is small with a help icon, and back is one link with an arrow (an anchor, not a paragraph).
- Link
- The link goes to the href you pass, or to the top of the page by default. The click handler doesn't prevent the default, so app routes call preventDefault, and in back the whole row is the anchor.
- Hover
- The link is underlined on hover, and the back link turns from secondary to full text colour. Neither change is animated.
- Focus
- The back link takes the library's focus ring. The inline link shows the browser's default outline, which the docs theme draws in indigo, and both are visible.
- Width and alignment
- The row fills its container and starts at the left, and justify-center or justify-end moves it. The back variant is as wide as its content, and with items-center on a flex parent the row shrinks.
- Long text
- The text wraps inside its own box and the link keeps what is left, so a long sentence squeezes the link into a word-by-word column. Letting the row wrap moves the whole link under the text.
- Semantics
- The row reads as text followed by a link, and the icon is hidden from assistive technology. Choose link text that makes sense out of context, and wrap changing text in a status region.
- Where it is used
- Sign-in, sign-up, forgot-password, verification, OTP, onboarding and team-invite blocks use it for the line under the form and for the way back.
- Motion and reduced motion
- None. The underline and the back link colour change at once, and reduced motion changes nothing.
Anatomy
The figure shows the icon variant, the only one with all three parts. The back variant is a single anchor with an arrow and the text, 8 px apart, and no second link.
Need help?Contact support
- 1data-slot="text-link-row"
A paragraph that lays its children out in one flex line, centred, 4 px apart. It is as wide as its container, starts at the left and has no border or background.
- 2Optional
A 16 px help icon in front of the text, only in the icon variant. It sits 8 px from the text.
- 3
The text in a span: 14 px secondary for inline, 12 px tertiary for small and icon, 14 px tertiary for stacked.
- 4Optional
The link, semibold in the link colour, 14 px (12 px in small and icon) and underlined on hover. Without a link no anchor is rendered.
Best practices
- Do
Keep the text to one short sentence and the link to one or two words. The text states the situation and the link names where it leads, such as Don't have an account, then Sign up.
- Do
Give the link a real href when it goes somewhere, since the default scrolls to the top. For an action that stays on screen, like Resend, handle the click and change the text so people see it worked.
- Do
Centre the row under a centred card with justify-center. By default the row fills its container and starts at the left.
- Do
Use the back variant for the way out of a step, last on the screen. It carries only text, so a link passed with it is ignored.
- Don’t
Don't put a long sentence in the text. It wraps in its own column and squeezes the link, so in a narrow container let the link wrap under the text.
- Don’t
Don't use it for the main or a destructive action. A text link is easy to miss and has no pressed or loading state, so use a Button.
- Don’t
Don't leave the href at the default for a link you don't handle. The page jumps to the top and the history gets an entry.
API reference
TextLinkRow is a plain component, not a wrapper of a primitive, so this table lists every prop. It doesn't pass other props on to its element.
A paragraph that lays its children out in one flex line, centred, 4 px apart. It is as wide as its container, starts at the left and has no border or background.
| Prop | Type | Default | Description |
|---|---|---|---|
| text required | ReactNode | — | The lead-in text, or the label of the back link. Any node; a string is the usual case. Required. |
| link | ReactNode | — | The label of the link after the text. Any node. Without it no anchor is rendered, and the back variant ignores it. |
| href | string | "#" | Where the link, or the back link, goes. Default . |
| onLinkClick | MouseEventHandler<HTMLAnchorElement> | — | Called when the link, or the back link, is clicked. The default action is not prevented. |
| variant | "inline" | "small" | "stacked" | "icon" | "back" | "inline" | is one 14 px line, one 12 px line, two centred lines, a help icon and a 12 px line, an arrow and one link. Default . |
| className | string | — | Extra classes for the root: the paragraph, or the anchor in the back variant. For example or . |
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("text-link-row")npx wunderui-cli add text-link-rowThe full library index for assistants is at /llms.txt.