Comments (6)
Thanks for the contribution! I made a new prerelease with your changes. Please try it and lmk if it solves your problem.
pip install dash-bootstrap-components==1.5.0rc4
from dash-bootstrap-components.
Hi @mapix
Thanks for the suggestion! I actually went ahead an implemented this independently as I didn't notice your final comment, sorry about that. You can see my changes in #971 and #973. You can also try it by installing the pre-release I made
pip install dash-bootstrap-components==1.5.0rc3
If you do try it with your app, I'd be keen to know how you get on.
There's a few differences with your implementation, including support for internal links, and making use of the as
prop in Carousel.Item
which means we don't have to create extra HTML elements that might interfere with Bootstrap's CSS.
I did however fail to implement the target
attribute, if you want to submit a PR adding that to my changes I would accept such a change. lmk if you would be interested and think this could be a useful feature.
Here's an example I tested my changes with:
import dash_bootstrap_components as dbc
from dash import Dash, Input, Output, dcc, html
app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
DBC_DOCS = "https://dash-bootstrap-components.opensource.faculty.ai/"
HOME_LAYOUT = dbc.Carousel(
items=[
{
"key": "1",
"src": f"{DBC_DOCS}/static/images/slide1.svg",
"href": "https://google.com",
},
{
"key": "2",
"src": f"{DBC_DOCS}/static/images/slide2.svg",
"href": "/internal",
},
{
"key": "3",
"src": f"{DBC_DOCS}/static/images/slide3.svg",
"href": "/internal",
"external_link": True,
},
],
controls=True,
indicators=True,
)
app.layout = dbc.Container(
[dcc.Location(id="url"), html.Div(id="contents")],
class_name="p-5",
)
@app.callback(Output("contents", "children"), Input("url", "pathname"))
def navigate(pathname):
if pathname == "/":
return HOME_LAYOUT
elif pathname == "/internal":
return "Some internal page..."
return "404: Not Found..."
if __name__ == "__main__":
app.run_server(debug=True)
from dash-bootstrap-components.
1.5.0rc3 looks good, but in my scenario, Carousel is in a Portal page, and it needs to be used to navigate multiple times to the sub applications. Therefore, customization of the target attribute is necessary. I added this attribute in #975 .
from dash-bootstrap-components.
@tcbegley
It works, Thank you very much !!!
from dash-bootstrap-components.
Great! Will make a full release in the next few days
from dash-bootstrap-components.
These changes are now in the latest release.
from dash-bootstrap-components.
Related Issues (20)
- Support tooltips without IDs HOT 3
- dbc.Select() not Displaying Options HOT 2
- dbc.Tabs not showing all tabs in expanded mode in 1.4.1 HOT 1
- Is there a way to use an icon as a label in a dbc.Tab element? HOT 2
- Alert component breaks multi-page navigation HOT 1
- Dash & XLwings. Attempting to pre-load Excel before Dash callback to save load time. HOT 3
- dbc.Input no type = 'file' HOT 6
- dbc.TextArea n_submit should not increment for Shift+Enter? HOT 3
- Dropdown presentation in data table doesn't work HOT 1
- Keyword argument for value OR placeholder HOT 2
- BUG: max doesn't work on nested progress bar HOT 3
- Docs app not working with Dash 2.14.0 HOT 3
- Allow icons and html in `dbc.AccordionItem()` title HOT 3
- Remove migration guide in docs
- selected attribute for dbc.Select HOT 1
- `dbc.Checklist` does not accept `label` as `list[Component]` like `dcc.Checklist` does HOT 3
- dash_bootstrap_components version versus python version HOT 5
- Nested tabs in `Offcanvas` component trigger scroll up event on tab change HOT 2
- Tooltip closing race condition with children change callback HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash-bootstrap-components.