Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Nav.Tile id mandatory and update examples #3097

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

phamduylong
Copy link
Contributor

Linked Issue

Closes #3085

Description

Make id mandatory on Nav.Tile instances

Changsets

Instructions: Changesets automate our changelog. If you modify files in /packages, run pnpm changeset in the root of the monorepo, follow the prompts, then commit the markdown file. Changes that add features should be minor while chores and bugfixes should be patch. Please prefix the changeset message with feat:, bugfix: or chore:.

Checklist

Please read and apply all contribution requirements.

  • This PR targets the dev branch (NEVER master)
  • Documentation reflects all relevant changes
  • Branch is prefixed with: docs/, feat/, chore/, bugfix/
  • Ensure Svelte and Typescript linting is current - run pnpm ci:check
  • Ensure Prettier linting is current - run pnpm format
  • All test cases are passing - run pnpm test
  • Includes a changeset (if relevant; see above)

Copy link

changeset-bot bot commented Jan 9, 2025

🦋 Changeset detected

Latest commit: 2aa638d

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

This PR includes changesets to release 2 packages
Name Type
@skeletonlabs/skeleton-svelte Patch
@skeletonlabs/skeleton-react Patch

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

Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
skeleton-docs ❌ Failed (Inspect) Jan 9, 2025 11:08pm

Copy link

vercel bot commented Jan 9, 2025

@phamduylong is attempting to deploy a commit to the Skeleton Labs Team on Vercel.

A member of the Team first needs to authorize it.

{/snippet}
{#snippet tiles()}
<Navigation.Tile id="0" labelExpanded="Browse Files" href={hrefExample}>
<Navigation.Tile id="1" labelExpanded="Browse Files" href={hrefExample}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phamduylong this is one of the only unique components we introduced that doesn't use Zag (intentionally). Now that I look at this, I wonder if rather than making ID mandatory, we utilize useId() to set a default automatically.

We didn't have access to useId() in Svelte when this component was built - that was introduced only when we integrated Zag. React has it built in as part of the library.

I think that'll provide a better experience - the ID will always be set, but users can still overwrite with a custom ID as they wish. Which would mean id would be optional again. Once less setting users have to deal with.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for me. A bit less work for users, I wouldn't like to specify these if they aren't practically useful for my project either. I'll implement that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants