Skip to content

feat(css): input-tile#4625

Open
oddvernes wants to merge 43 commits intomainfrom
feat/input-tiles
Open

feat(css): input-tile#4625
oddvernes wants to merge 43 commits intomainfrom
feat/input-tiles

Conversation

@oddvernes
Copy link
Copy Markdown
Collaborator

@oddvernes oddvernes commented Mar 13, 2026

resolves #526
resolves #529

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 13, 2026

🦋 Changeset detected

Latest commit: 99e01d4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@digdir/designsystemet-css Minor
@digdir/designsystemet-react Minor
@digdir/designsystemet Minor
@digdir/designsystemet-types Minor
@digdir/designsystemet-web Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@oddvernes oddvernes added experiment ⚗️ Experimenting new features or technical solutions css @digdir/designsystemet-css labels Mar 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

Preview deployments for this pull request:

storybook - 10. Apr 2026 - 14:33

www - 10. Apr 2026 - 14:41

@Febakke
Copy link
Copy Markdown
Member

Febakke commented Mar 17, 2026

This looks great 🎉 I have no notes on the design. What do you think about creating component variables for background colors on the different states? If I wanted a heavier "hover" state for instance i could just overwrite the background color variable for hover? Does that make sense?

I noticed the error message was placed inside the "tile". Would it be possible for our users to add it outside of the border? Looks a little weird inside to me, but there might be usecases where this make sense. Here are some example on how I would have set it up.
godtar
exampleerror

What do you think about the read-only variant? I noticed that I get the "clickable" cursor when im not over the input / label element. Not sure if its a problem.

I noticed some weird screen reader behaviour on some of the examples, but we can look at that later maybe?

@oddvernes
Copy link
Copy Markdown
Collaborator Author

This looks great 🎉 I have no notes on the design. What do you think about creating component variables for background colors on the different states? If I wanted a heavier "hover" state for instance i could just overwrite the background color variable for hover? Does that make sense?

Yes I have thought about this too, can add this with transparent as default

I noticed the error message was placed inside the "tile". Would it be possible for our users to add it outside of the border? Looks a little weird inside to me, but there might be usecases where this make sense. Here are some example on how I would have set it up.

Error message immediately below the input is a built in feature from before so this is why I included an example. We just don't use it in our examples, usually we add ValidationMessage to the Fieldset as your image

What do you think about the read-only variant? I noticed that I get the "clickable" cursor when im not over the input / label element. Not sure if its a problem.

This is an oversigth, will fix!

I noticed some weird screen reader behaviour on some of the examples, but we can look at that later maybe?
👍

@oddvernes oddvernes marked this pull request as ready for review March 18, 2026 11:33
@oddvernes
Copy link
Copy Markdown
Collaborator Author

oddvernes commented Mar 18, 2026

Setting it as ready for review because i want feedback before adding www docs. The tile example story is in checkbox

Questions:

  • Naming. I called it selection-tile (since it affects selection controls only). It could alternatively be called selection-panel 🤷
  • selector. class or data-attr or both? (currently it is both). Normally components have class as outermost selector and data-attr for modifiers. This is both outermost and a modifier

I also introduce a new layer here (ds.utils) since this is a utility and utilities should generally have highest specificity since it is something meant to modify something existing

I made a utils.css thinking we could put other stuff here (like potentially data-pad that @eirikbacker suggested and other planned layout stuff). But the amount of code perhaps suggests it should be individual files (selection-tile.css)

@mimarz
Copy link
Copy Markdown
Collaborator

mimarz commented Mar 19, 2026

Some thoughts from slack discussion:

  • How do we flag experimental CSS features?

@oddvernes
Copy link
Copy Markdown
Collaborator Author

Some thoughts from slack discussion:

* How do we flag experimental CSS features?

The only way to do it I can think of is how we did it for things like .togglegroup that got re-named to .toggle-group, you start off with data-experimental-selection-tile / .ds-experimental-selection-tile and then when it is ready add on data-selection-tile / .ds-selection-tile without removing the old selectors. Then a year down the line remove the old selectors in a future major.
But I don't really see the purpose of this. It feels like overkill and built in breaking change just to communicate something that can be noted in docs without creating future work 🤷

@mimarz
Copy link
Copy Markdown
Collaborator

mimarz commented Mar 19, 2026

Meeting 19 march with @oddvernes @Barsnes @mimarz

  • selection-tile 👍
  • Define as class for now, add data attr later if needed.
  • Add new experimental export and folder with named file for feature so people can import it as; @digdir/designsystemet-css/experimental/selection-tile.css.

@mimarz mimarz removed the experiment ⚗️ Experimenting new features or technical solutions label Mar 19, 2026
@mimarz
Copy link
Copy Markdown
Collaborator

mimarz commented Mar 23, 2026

Meeting today with @mimarz @oddvernes and @eirikbacker.

@eirikbacker suggested to look at if we could build this into ds-field as a variant instead of separate class to reduce concepts/utils. He'll follow up with an example/poc for how that could be solved.

Co-authored-by: Oddbjørn Øvernes <oddbjorn.overnes@gmail.com>
Co-authored-by: Michael Marszalek <mimarz@gmail.com>
@oddvernes
Copy link
Copy Markdown
Collaborator Author

Ready for review again 👍
For docs I just duplicated the "group" story for each component with outline variant and used the same description everywhere so it is easy to edit with search and replace if needed

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

Labels

css @digdir/designsystemet-css

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Input Tiles (Radio and Checkbox Panel) RadioPanel: Develop React component

4 participants