Skip to content

Toggle visibility of navigation rail #1528

@bgebelein

Description

@bgebelein

Description

Currently the navigation rail can either be used or not. It is not possible to show / hide the navigation rail on demand.

It would be nice to be able to toggle the visibility of the navigation rail.

Considerations

From what i understand, the navigation rail is a plugin and not a basic puck feature.
Also the navigation rail holds mostly other plugins as their content.
It needs to be considered wether to implement this on the plugin side or on puck side.

Proposals

Proposal 1

I would like to see a solution that is part of the Puck API.
Similar to hiding the sidebars.

const usePuck = createUsePuck();
const dispatch = usePuck((s) => s.dispatch);

const togglePreview = () => {
    dispatch({
      type: "setUi",
      ui: {
        navigationRailVisible: false,
      },
    });
  };

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions