Skip to content

Discussion: TextLink component #2947

Open
@lindapaiste

Description

@lindapaiste

Tasks

  • Decide what our basic link style should look like - particularly the color (see comment re: contrast)
  • Determine the props API for the TextLink component based on how we want to customize the style for specific use-cases
  • Write the TextLink component
  • Rewrite existing links in the app to use TextLink

Increasing Access

We want to keep the codebase clean and keep the design consistent.

Feature enhancement details

We have had many issue recently relating to the visibility of text links throughout the app. I would like to centralize the discussion here.

The recurring problem is that it's not clear to the user that a certain text is a clickable link. We can improve this by changing the default style of the link as well as adding hover styles to make it look more interactive.

I don't want us to add lots of specific CSS to specific component because this is difficult to maintain. I think this is a good opportunity for us to expand our library of reusable core UI components with a TextLink. We might not want to have the exact same styles everywhere, so we'll want to have some props which can control styles.

The goal of this issue is to discuss our API for the TextLink component and finalize what props we want.

Depending on the API that we choose, the code might look like any of these:

<TextLink href={url} underline="hover" color="always">anchor</TextLink>
<TextLink href={url} underline="hover" color="primary">anchor</TextLink>
<TextLink href={url} primary bold>anchor</TextLink>

^ This last one uses boolean props and is concise but probably more confusing.

Ideas for props:

  • underline with values "always", "hover", "none" (what MUI uses)
  • color with values "always", "hover", "none" to apply the theme primary accent color (pink or yellow)
  • color with values "primary", "inherit", etc. to choose from multiple theme colors (what MUI uses)
  • primary as a boolean flag to make it pink (this wouldn't allow for pink-on-hover behavior)
  • bold with values "always", "hover", "none" ("hover"` shouldn't be used here, but keeps it consistent)
  • bold as a boolean flag
  • fontWeight with values "bold" or "inherit"
  • display with values "inline" (default) and "block"

Specific related issues:

References / how others handle this:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions