Documentation
¶
Overview ¶
Copyright 2026 Teradata
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package filepicker provides a file picker component (stub replacement for charm.land/bubbles/v2/filepicker).
Index ¶
- type KeyMap
- type Model
- func (m Model) CurrentDir() string
- func (m Model) DidSelectFile(msg tea.Msg) (bool, string)
- func (m Model) HighlightedPath() string
- func (m Model) Init() tea.Cmd
- func (m Model) Selected() string
- func (m *Model) SetHeight(h int)
- func (m *Model) SetSize(width, height int)
- func (m *Model) SetStyles(s Styles)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- type Option
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// Exported fields for compatibility
CurrentDirectory string
AllowedTypes []string
ShowPermissions bool
ShowSize bool
AutoHeight bool
Cursor string
Styles Styles
KeyMap KeyMap
// contains filtered or unexported fields
}
Model is a file picker component.
func (Model) CurrentDir ¶
CurrentDir returns the current directory.
func (Model) DidSelectFile ¶
DidSelectFile returns true if a file was selected in this update.
func (Model) HighlightedPath ¶
HighlightedPath returns the path of the currently highlighted item.
type Option ¶
type Option func(*Model)
Option configures the file picker.
func WithAllowedTypes ¶
WithAllowedTypes sets allowed file types.
func WithCurrentDir ¶
WithCurrentDir sets the current directory.
func WithFileAllowed ¶
WithFileAllowed allows file selection.
type Styles ¶
type Styles struct {
Cursor lipgloss.Style
Symlink lipgloss.Style
Directory lipgloss.Style
File lipgloss.Style
Permission lipgloss.Style
Selected lipgloss.Style
DisabledCursor lipgloss.Style
DisabledFile lipgloss.Style
DisabledSelected lipgloss.Style
EmptyDirectory lipgloss.Style
FileSize lipgloss.Style
}
Styles configures file picker appearance.