JedWatson / JedWatson/react-select

Documentation: make parameter types more obvious/uncollapsed by default for functions

Open
#5,216 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Originally posted by leothorp June 4, 2022
I was looking at https://react-select.com/props, and was initially stumped by what looked like a lack of any information on function parameters. This screenshot shows an example of what I saw:
image

Eventually I happened to mouseover the ... and realized it can be clicked to be expanded. I think this is not obvious. a faint ... doesn't look like a clickable UI element, and primitive types (like the return value here) are already shown as normal, so it didn't occur to me I had to click something to see parameter types. The same comment applies to object/nested types, clicking at further levels inside wasn't very discoverable.

Can we consider either expanding the first level of these by default, or making it more obvious somehow that this is clickable? One easy fix that occurs to me is just replacing ... with something like (click to expand), or even just expand.

Thanks for reading.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the react-select.com/props documentation page and inspect how function parameter and nested object types are rendered. Compare the collapsed ellipsis with the proposed expanded or clearer affordance, then verify that the first-level parameter types and deeper nested types are discoverable as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
documentation, frontend
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.