elements icon indicating copy to clipboard operation
elements copied to clipboard

`hideTryIt="false"` hides the Try It section

Open Minucia opened this issue 1 year ago • 0 comments

When integrating elements into a Docusaurus project, and setting hideTryIt="false", the Try It section is not shown.

Context

I want to set the value of the hideTryIt flag to make it configurable through code. But at the moment, the only way to show the Try It section is to not add the flag at all.

Current Behavior

When hideTryIt is set to false, the Try It section is not shown. image

Expected Behavior

When hideTryIt is set to false, the Try It section should be shown. image

Possible Workaround/Solution

The Try It section is shown when the hideTryIt config is not set at all (default is false). But that doesn't help when the flag needs to be set in code.

Steps to Reproduce

  1. Add @stoplight/elements to a (Docusaurus) project via npm.
  2. Integrate elements into a page by using the following code:
import { API } from '@stoplight/elements';
import '@stoplight/elements/styles.min.css';

<API apiDescriptionUrl="TrainTravelAPI.yaml" layout="stacked" hideTryIt="false"/>
  1. Take a look at the endpoint in the API reference. The Try It section is not shown: image

Environment

  • @stoplight/elements version 8.5.2
  • node version 20.18.1
  • Docusaurus version 3.5.2
  • Chrome version 131.0.6778.109
  • Windows 11

Minucia avatar Dec 12 '24 13:12 Minucia