BranchPicker
Navigation
메시지의 분기 응답 사이를 오가는 이전/다음 컨트롤.
Usage
재생성으로 여러 응답 분기가 생긴 메시지에서 분기 사이를 이동할 때 사용한다.
import
import
BranchPicker 하나만 가져오면 BranchPicker.Previous · BranchPicker.Next · BranchPicker.Number · BranchPicker.Count 를 그 아래에서 쓸 수 있다.
예제를 복사해 쓸 때 필요한 준비
• @mildang/styled-system 은 이 저장소에서 Panda 가 생성하는 산출물이다. 저장소 안에서는 turbo run ship 이후 쓸 수 있고, 패키지 소비자는 자기 Panda 산출물이나 다른 레이아웃 수단으로 바꿔야 한다.
• 외부 패키지를 따로 설치한다. DS 의 전이 의존성에 기대지 않는다.
Anatomy
tsx
부품
필수 여부
반복
위치
BranchPicker.Previous
BranchPicker.Number
BranchPicker.Count
BranchPicker.Next
- 분기가 하나뿐이면 기본적으로 숨긴다(hideWhenSingleBranch 기본 true).
- 메시지 컨텍스트가 필요하므로 ThreadPrimitive.Messages 안에서 렌더한다.
API Reference
BranchPicker Props
Prop
Type
Default
boolean
지정 안 함
boolean
false
import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>
지정 안 함
BranchPicker.Previous
이전 분기로 이동하는 버튼이다.
Prop
Type
Default
boolean
지정 안 함
ReactNode
지정 안 함
import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>
지정 안 함
BranchPicker.Number
현재 분기의 순번을 보여준다.
공개 Props 없음
BranchPicker.Count
전체 분기 개수를 보여준다.
공개 Props 없음
BranchPicker.Next
다음 분기로 이동하는 버튼이다.
Prop
Type
Default
boolean
지정 안 함
ReactNode
지정 안 함
import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>
지정 안 함
예제
기본 사용
여러 응답 분기 사이를 이전/다음으로 이동하는 예시다.
코드