NotionX / NotionX/react-notion-x

Open search dialog from external

Open
#112 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
TypeScript
Stars
5.4k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

Feature Request: Change search state externally

I suggest a feature that externally changable searchOpen state
I guess, this file is implementing searhOpen state like this

  const [isSearchOpen, setIsSearchOpen] = React.useState(false)
  const onOpenSearch = React.useCallback(() => {
    setIsSearchOpen(true)
  }, [])

  const onCloseSearch = React.useCallback(() => {
    setIsSearchOpen(false)
  }, [])

I'm not sure how to make this feature as code, but I suggest some applicable functions by this feature

example functions
  • ctrl + p shortcut for activate search dialog like notion.so
  • Auto open search dialog modal when open landing page (what I want to do)

Thanks for this great project

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 with packages/react-notion-x/src/components/page-header.tsx, where the issue identifies the internal searchOpen state and handlers. Read the surrounding page-header usage to determine how search is exposed and what external callers can access. Done should provide a defined way to open the search dialog from outside the component, with the supported external trigger made clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.