ic-design-system icon indicating copy to clipboard operation
ic-design-system copied to clipboard

Display type definitions on the site

Open GCHQ-Developer-530 opened this issue 9 months ago • 2 comments

Summary

At the moment, in the props table we display what type a prop is e.g. string, boolean, etc. But for our own custom types, it has no explanation for what that type is.

Image

An example is options ^ which has IcMenuOption[] type but a user wouldn't know what that is.

💬 Description

We need a way of displaying the type definitions. It will need design to look into it, but 2 ideas I've had are:

  1. A page we can link to from the props table (like we do with the slot table description that's on every component page) which contains a list of all the types.
  2. A Types table below the Props table with the specific custom types used for that component. This way it might fit in nicely with the Events and Slots tables too.

💰 Use value

Users can easily see type definitions.

GCHQ-Developer-530 avatar Apr 09 '25 13:04 GCHQ-Developer-530

I second this request. Justification for option 1: "Assuming the Components page is intended to support primarily developers but also designers, we need to make this information easily available for developers whilst not cluttering the material for designers."

tg840104 avatar Apr 10 '25 07:04 tg840104

Image

Should be able to access the type/complexType resolved from the docs.json

GCHQ-Developer-530 avatar Apr 24 '25 08:04 GCHQ-Developer-530