-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Boilerplate for bottom navigation bar * Add bottom navigation bar item * Boilerplate for bottom navigation bar * Add bottom navigation bar item * Complete implementation * Commit from GitHub Actions (Forui Presubmit) * Update changelog * Commit from GitHub Actions (Forui Samples Presubmit) * Fix pr issues
- Loading branch information
Showing
19 changed files
with
806 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import {Callout} from "nextra/components"; | ||
import { Tabs } from 'nextra/components'; | ||
import { Widget } from "../../components/widget"; | ||
|
||
# Bottom Navigation Bar | ||
|
||
A bottom navigation bar is usually present at the bottom of root pages. | ||
It is used to navigate between a small number of views, typically between three and five. | ||
|
||
<Tabs items={['Preview', 'Code']}> | ||
<Tabs.Tab> | ||
<Widget name='bottom-navigation-bar' query={{}}/> | ||
</Tabs.Tab> | ||
<Tabs.Tab> | ||
```dart | ||
class Application extends StatefulWidget { | ||
const Application({super.key}); | ||
@override | ||
State<Application> createState() => _ApplicationState(); | ||
} | ||
class _ApplicationState extends State<Application> { | ||
int index = 1; | ||
@override | ||
Widget build(BuildContext context) => FBottomNavigationBar( | ||
index: index, | ||
onChange: (index) => setState(() => this.index = index), | ||
items: [ | ||
FBottomNavigationBarItem( | ||
icon: FAssets.icons.home, | ||
label: 'Home', | ||
), | ||
FBottomNavigationBarItem( | ||
icon: FAssets.icons.layoutGrid, | ||
label: 'Browse', | ||
), | ||
FBottomNavigationBarItem( | ||
icon: FAssets.icons.radio, | ||
label: 'Radio', | ||
), | ||
FBottomNavigationBarItem( | ||
icon: FAssets.icons.libraryBig, | ||
label: 'Library', | ||
), | ||
FBottomNavigationBarItem( | ||
icon: FAssets.icons.search, | ||
label: 'Search', | ||
), | ||
], | ||
); | ||
} | ||
``` | ||
</Tabs.Tab> | ||
</Tabs> | ||
|
||
## Usage | ||
|
||
<Callout type="info"> | ||
A bottom navigation bar is typically used with `FScaffold`. A working example can be found [here](/docs/scaffold). | ||
</Callout> | ||
|
||
### `FBottomNavigationBar(...)` | ||
|
||
```dart | ||
FBottomNavigationBar( | ||
index: 0, | ||
onChange: (index) => {}, | ||
items: [ | ||
FBottomNavigationBarItem( | ||
icon: FAssets.icons.home, | ||
label: 'Home', | ||
), | ||
], | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.