Skip to content

[docs] Mark required props in API docs #1756

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Apr 21, 2025

@ZeeshanTamboli ZeeshanTamboli added docs Improvements or additions to the documentation bug 🐛 Something doesn't work labels Apr 21, 2025
Copy link

netlify bot commented Apr 21, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 4accd31
🔍 Latest deploy log https://app.netlify.com/sites/base-ui/deploys/680a33ba34799800088f6430
😎 Deploy Preview https://deploy-preview-1756--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review April 21, 2025 08:59
@colmtuite
Copy link
Contributor

Why does this need to be documented? It becomes clear pretty quickly in the IDE, no? I'm not a fan of adding superfluous content to the actual prop name in the docs, it could be misleading.

@ZeeshanTamboli
Copy link
Member Author

Why does this need to be documented? It becomes clear pretty quickly in the IDE, no? I'm not a fan of adding superfluous content to the actual prop name in the docs, it could be misleading.

Then why document any props at all if they're visible in the IDE? Also, did you see this comment? #1694 (comment)

@colmtuite
Copy link
Contributor

Well because not all props are equal in this regard. I'm not saying nothing should change here, I'm just saying that making the prop names inaccurate in the table is not the right solution.

@ZeeshanTamboli
Copy link
Member Author

I'm just saying that making the prop names inaccurate in the table is not the right solution.

I assume you're referring to the asterisk after the prop names. From what I've seen, it's a common convention — for example:

Do you have a different suggestion in mind?

@atomiks
Copy link
Contributor

atomiks commented Apr 24, 2025

I think the asterisk is ok but it needs to be in a <sup>, maybe red too (Mantine does this at least). This matches the common convention of required fields in forms all over the web. The * on the same level as the prop name looks a bit odd

@ZeeshanTamboli
Copy link
Member Author

I think the asterisk is ok but it needs to be in a <sup>, maybe red too (Mantine does this at least). This matches the common convention of required fields in forms all over the web. The * on the same level as the prop name looks a bit odd

@atomiks Made the changes.

Copy link
Contributor

@atomiks atomiks left a comment

Choose a reason for hiding this comment

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

This change looks fine to me 👍

cc: @colmtuite @mnajdova @michaldudak

Perhaps title="required" or something else is required for screen readers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Radio docs are incorrect/lacking
3 participants